Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

JavaScript News Scroller

Posted on 2005-04-29
2
Medium Priority
?
263 Views
Last Modified: 2008-02-01
I've developed an IFRAME named "if1". In it loads a page that must introduce a News Scroller. I like to scroll my desirect text from bottom to up, alongwith the 'pause'.  activity. On onMouseOver activity, the scrolling must pause till the onMouseOut activity is being called n the text continues scrolling from where it got paused. Could anybody plz write me the code?
0
Comment
Question by:adnan_from_hiit
2 Comments
 

Author Comment

by:adnan_from_hiit
ID: 13907379
OK its been done. Here is the solution

<head>
<style type="text/css">  
#divContainer{
      position:absolute;
      width:200px;
      height:70px;
      overflow:hidden;
      top:20px;
      visibility:hidden;
}
#divContent{
      font-family:verdana;
      font-size:10px;
      position:absolute;
      cursor:default;
}      
.link {
      text-decoration:none;
      color:black;
}
.linkOver {
      font-weight:bold;
      text-decoration:none;
      color:brown;
}
</style>
<script language="JavaScript">
      var i,c=0,scrl=true;;
      function InitialiseScrollableArea(){
            i = divContainer.offsetHeight+10;      
            divContent.style.top = i;
            divContainer.style.visibility='visible';
          divContainer.style.left=0;
          divContainer.style.bottom=0;
            setInterval('ScrollText()',20);
      }
      function ScrollText() {
            if (!scrl) return;
            divContent.style.top=i--;
            if (divContent.offsetHeight < divContainer.offsetHeight) {
                  if (i == -divContainer.offsetHeight) i = divContainer.offsetHeight+10;
                  return;
            }
            
            if (Math.abs(i) > divContent.offsetHeight) {
                  i = divContainer.offsetHeight+10;      
            }
      }
</script>

</head>

<body onLoad="InitialiseScrollableArea()">

<div id="divContainer">
  <div id="divContent">
        <a href="#" onMouseOver="javascript:scrl=false;this.className='linkOver';" onMouseOut="javascript:scrl=true;this.className='link'" class="link" style="color:#67777C;">Visit our newly furnished website</a>
        <br><br><br>
        <a href="#" onMouseOver="javascript:scrl=false;this.className='linkOver';" onMouseOut="javascript:scrl=true;this.className='link'" class="link" style="color:#67777C;">Administrators click here</a>
  </div>
</div>


</body>
0
 

Accepted Solution

by:
PAQ_Man earned 0 total points
ID: 13914014
Question Closed, 50 points refunded.
PAQ_Man
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question