First off; im a new user to Joomla and SMF bridge and so far it rocks! Thank for the time spent on this. I still have a few bugs here and their but its to be expected (Im sure 99% is user error at this point ) Anyhow; I really like the recent topics module with the marquee scrolling. One of my test users suggested that it pause for a few seconds when It reached the top of the text area and then continued. I thought this was a great idea so I made the following modifications to the code. I am a PHP coder and know little on Javascript (shame on me--so this prolly could be better)Find in File: "mod_smf_recenttopics.php" About Line 388 Code: var actualheight = \'\ Add after that:Code: var pausepoint = 0 Replace the existing scrollmarquee() function to the following: Code: function scrollmarquee() { if (parseInt(cross_marquee.style.top) > (actualheight*(-1)+8)) { cross_marquee.style.top = parseInt(cross_marquee.style.top)-copyspeed+"px" } else { cross_marquee.style.top = parseInt(marqueeheight)+8+"px" } if (cross_marquee.style.top == pausepoint*(-1)+"px") { copyspeed=pausespeed pausepoint=pausepoint*2 setTimeout(\'copyspeed=marqueespeed\', delayb4scroll*2) } if (cross_marquee.style.top == "0px") { copyspeed=pausespeed setTimeout(\'copyspeed=marqueespeed\', delayb4scroll*2) pausepoint = marqueeheight } } How it works: It will pause for double of what your 'delay before start' setting is. I have this set to 2 seconds for my install; so it will pause 4 seconds when it reaches the top of the text area. Another simple little hack I added was the ability to back up the scolling a few lines when the user clicks on white space in the text area (not a topic link) Find in file: Code: <div id="marqueecontainer" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed" style="position: relative; height: '.$scroll_height.'px; overflow: hidden; padding: 2px;"> <div id="vmarquee" style="position: absolute; width: 98%;">'; Change to: Code: <div id="marqueecontainer" onmousedown="copyspeed=-1" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed" style="position: relative; height: '.$scroll_height.'px; overflow: hidden; padding: 2px;"> <div id="vmarquee" style="position: absolute; width: 98%;">'; There ya go... my hacks for the cause.. Enjoy. ![]() |
Forum 





Author



) Anyhow; I really like the recent topics module with the marquee scrolling. One of my test users suggested that it pause for a few seconds when It reached the top of the text area and then continued. I thought this was a great idea so I made the following modifications to the code. I am a PHP coder and know little on Javascript (shame on me--so this prolly could be better)
Logged










