Home arrow Forum Latest posts of: Robert
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 08:05:27 PM
Home New Posts Search Calendar


Login with username, password and session length
  Show Posts
Pages: [1]
1  Joomla Addon Discussion / Joomla Modules / Re: My Dirty Marquee Hack on: January 18, 2007, 06:00:54 PM
No problem by me if you find it to be a worthy addition.   Cool

2  Joomla Addon Discussion / Joomla Modules / 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


Pages: [1]


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
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
MamboBuzz.com
Search Contact About Advertise Blogs Topsites Submit News Register Login