[Mod] Better Links Scrolling


Subject: [Mod] Better Links Scrolling
Hile, neighbors and friends...

To tell the truth, I don't like at all the way the "Links Block" scrolls. Dunno how is it in IE, but in FFox, it doesn't scroll to the top of the block and when you put the mouse over and move it way up, the scroll doesn't stop... So I've been investigating and have modified the block to include a javascript function to control the scrolling function...

---Open templates/xxx/blocks/links_block.tpl---

---SEARCH---
Code: [Download] [Hide]
  1. <!-- BEGIN links_scroll --> 


---AFTER ADD---
Code: [Download] [Hide]
  1. <script type="text/javascript">  
  2. /***********************************************  
  3. * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)  
  4. * This notice MUST stay intact for legal use  
  5. * Visit http://www.dynamicdrive.com/ for this script and 100s more.  
  6. ***********************************************/  
  7.  
  8. var delayb4scrollx=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)  
  9. var marqueespeedx=1 //Specify marquee scroll speed (larger is faster 1-10)  
  10. var pauseitx=1 //Pause marquee onMousever (0=no. 1=yes)?  
  11.  
  12. ////NO NEED TO EDIT BELOW THIS LINE////////////  
  13.  
  14. var copyspeedx=marqueespeedx  
  15. var pausespeedx=(pauseitx==0)? copyspeedx: 0  
  16. var actualheightx=''  
  17.  
  18. function scrollmarqueex(){  
  19. if (parseInt(cross_marqueex.style.top)>(actualheightx*(-1)+8))  
  20. cross_marqueex.style.top=parseInt(cross_marqueex.style.top)-copyspeedx+"px"  
  21. else  
  22. cross_marqueex.style.top=parseInt(marqueeheightx)+8+"px"  
  23. }  
  24.  
  25. function initializemarqueex(){  
  26. cross_marqueex=document.getElementById("vmarqueex")  
  27. cross_marqueex.style.top=0  
  28. marqueeheightx=document.getElementById("marqueecontainerx").offsetHeight  
  29. actualheightx=cross_marqueex.offsetHeight  
  30. if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit  
  31. cross_marqueex.style.height=marqueeheightx+"px"  
  32. cross_marqueex.style.overflow="scroll"  
  33. return  
  34. }  
  35. setTimeout('lefttime=setInterval("scrollmarqueex()",30)', delayb4scrollx)  
  36. }  
  37.  
  38. if (window.addEventListener)  
  39. window.addEventListener("load", initializemarqueex, false)  
  40. else if (window.attachEvent)  
  41. window.attachEvent("onload", initializemarqueex)  
  42. else if (document.getElementById)  
  43. window.onload=initializemarqueex  
  44. </script> 


---SEARCH---
Code: [Download] [Hide]
  1. <marquee id="links_block" behavior="scroll" direction="up" scrolldelay="100" height="80" scrollamount="2" loop="true" onmouseover="this.stop()" onmouseout="this.start()">  
  2. <div class="center-block-text">  
  3. <div class="gen">  
  4. <br />  
  5. <!-- BEGIN links_row -->  
  6. <a href="{static.links_row.LINK_HREF}" target="_blank" onmouseover="document.all.links_block.stop()" onmouseout="document.all.links_block.start()"><img src="{scroll.links_row.LINK_LOGO_SRC}" alt="{scroll.links_row.LINK_TITLE}" title="{scroll.links_row.LINK_TITLE}" width="{SITE_LOGO_WIDTH}" height="{SITE_LOGO_HEIGHT}" border="0" vspace="3" /></a><br /><br />  
  7. <!-- END links_row -->  
  8. <br />  
  9. </div>  
  10. </div>  
  11. </marquee> 


---REPLACE WITH---
Code: [Download] [Hide]
  1. <div id="marqueecontainerx" style="position: relative; width: 95%; height: 100%; overflow: hidden; border: 0px; padding: 2px; padding-left: 4px;" onmouseover="copyspeedx=pausespeedx" onmouseout="copyspeedx=marqueespeedx">  
  2. <div id="vmarqueex" style="position: absolute; width: 98%;">  
  3. <div align="center">  
  4. <div class="center-block-text">  
  5. <div class="gen">  
  6. <br />  
  7. <!-- BEGIN links_row -->  
  8. <a href="{static.links_row.LINK_HREF}" target="_blank"><img src="{scroll.links_row.LINK_LOGO_SRC}" alt="{scroll.links_row.LINK_TITLE}" title="{scroll.links_row.LINK_TITLE}" width="{SITE_LOGO_WIDTH}" height="{SITE_LOGO_HEIGHT}" border="0" vspace="3" /></a><br /><br />  
  9. <!-- END links_row -->  
  10. <br />  
  11. </div>  
  12. </div>  
  13. </div>  
  14. </div>  
  15. </div> 


You can see how it works in my test site and in my live site

Subject: Re: [Mod] Better Links Scrolling
Thanks Xusqui and moved to Customizations Forum :wink:

Inactive User
Subject: Re: [Mod] Better Links Scrolling
Look good with IE7 - Nice fix. 8)

Subject: Re: [Mod] Better Links Scrolling
This is nice.

I will test it.

Subject: Re: [Mod] Better Links Scrolling
looks much better..

thanks for this :)


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0803s (PHP: 21% SQL: 79%)
SQL queries: 10 - Debug Off - GZIP Enabled