Home arrow Forum My Dirty Marquee Hack
  Welcome, Guest. Please login or register.
Did you miss your activation email?
September 05, 2008, 07:16:38 PM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Addon Discussion
| |-+  Joomla Modules
| | |-+  My Dirty Marquee Hack
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: My Dirty Marquee Hack  (Read 734 times)
Robert
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 2


View Profile
My Dirty Marquee Hack
« on: January 17, 2007, 03:57:52 PM »

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 Smiley) 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.  Smiley


Logged
-Wolverine
Developer
Joomla Guru
*****

Karma: +374/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: My Dirty Marquee Hack
« Reply #1 on: January 18, 2007, 04:57:30 PM »

hmmmm, interesting, when I get some time to test it Ill roll it back into the core module if you have no problems with that.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Robert
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 2


View Profile
Re: My Dirty Marquee Hack
« Reply #2 on: January 18, 2007, 06:00:54 PM »

No problem by me if you find it to be a worthy addition.   Cool

Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal.
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use