Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 02:56:09 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155364 Posts in 21694 Topics by 7729 Members
Latest Member: piset
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Creating scrolling news ticker that stops on mouse over  (Read 5067 times)
Availor

Offline Offline

Posts: 225



« on: June 14, 2008, 01:01:33 PM »

 

The code

Code:
<marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()" scrolldelay="1" scrollamount="2" height="150">

YOUR CONTENT GOES HERE
    </marquee>


In order for the content to move (the scrolling content):
<marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()" scrolldelay="1" scrollamount="2" height="150">

<div class="news">

YOUR CONTENT GOES HERE
</div>
    </marquee>
 
While the css code will be
 
Code:
.news {
height: 400px;
list-style-type: none;
}


The css news class removes he list style bullets. It is not necessary unless you are using the <ul> style. In my case I use them to show the header of my news.
 
height: 400px;

Specifies the inner content height that will be scrolled.
 

The marquee command:

Code:
<marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()" scrolldelay="1" scrollamount="2" height="150">
direction="up"  tells which direction the scrolling will be.

scrolldelay="1" scrollamount="2" sets the speed of scrolling and the gap between the lines (just change the numbers and test it for yourself)

height="150" – This is the height that will be seen in your website.
Example:

This is my example, using anews module
 

Code:
<marquee direction="up" onmouseover="this.stop()" onmouseout="this.start()" scrolldelay="1" scrollamount="2" height="150">

    <div class="news">

    <?php display_news_items(051002"The latest news""show full news text""no news available"false); ?>

    </div>

    </marquee>

 See the example here

http://www.websitebakerden.com/demo/portal/
Logged
marathoner

Offline Offline

Posts: 495


« Reply #1 on: June 14, 2008, 02:22:34 PM »

Be aware that the MARQUE tag is not a valid tag and usage of it will result in code that doesn't validate. It was created by Microsoft and is supported by a couple of browsers, but was never accepted by the W3C standards committee.
Logged
Availor

Offline Offline

Posts: 225



« Reply #2 on: June 14, 2008, 08:54:45 PM »

I can live with that  grin
It's simple and it works in FF and in ie7. Sometimes a simple solution is the best one and for that matter it's a good choice of solution.
Logged
marathoner

Offline Offline

Posts: 495


« Reply #3 on: June 15, 2008, 02:02:31 PM »

I agree with you. I simply wanted to make sure that folks that place importance on valid code know the status of the MARQUE tag.
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7972



WWW
« Reply #4 on: June 15, 2008, 02:37:56 PM »

Hello,

just an idea to make the handling for users more easily. What about making modul from this? This way it can be configured from the backend and used in the frontend as normal section or as global section. User can then change all options and the scrollcontent from within the wb backend. Also using WB 2.7 technics css can be edited from within the backend.

What do you think about this?

Matthias
Logged
Availor

Offline Offline

Posts: 225



« Reply #5 on: June 15, 2008, 04:31:53 PM »

Well actually that's the idea, but I don't know how to create modules  rolleyes
I wish that by pasting some of stuff I make here someone will make a module out of it for others to enjoy  tongue
I am not a coder and All I do is search for code snippets and adjust them for my need as my logic tells me to.

Anyhow, I have no idea how to create a module. I can only modify something since my skills are very basic. I've started learning XML and php scripting using sitepoint book so maybe I will come up with something eventually  cheesy
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!