Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2004, 01:51 AM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default please help!

Hi everyone. Need a little help. On the webste I'm working on, I need to have something similar to this: http://www.staind.com (the News section). I want to have the "news" with up and down arrows that work on mouse over. I'm guessing javascript (I'm a newbie), but I can't seem to find what I need on the web. Thanks for any and all responses.
 
Old December 1st, 2004, 06:24 AM
Authorized User
 
Join Date: Oct 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

You could try

http://www.dynamicdrive.com/dynamici...nualscroll.htm

they have some DHTML scrollers like the one you are after, good resource site. Have you considered using Flash, it gives a much smoother scroll effect than Javascript. Try this site

http://actionscript-toolbox.com/sampletextscroller.php

David
 
Old December 1st, 2004, 10:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I actually just posted something about this in the flash forum I created. It will actually load your text from a plain .txt file created the box on the fly and input the text. you can find the code at
http://p2p.wrox.com/topic.asp?TOPIC_ID=22496

Peace
Mike
 
Old December 1st, 2004, 10:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just realized i didn't include the scrolling code that goes with this, if you can wait i will post it here in a while.

Mike
 
Old December 1st, 2004, 02:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here is the scrolling function, just create buttons, call one up_btn and one down_btn and with the script above you should be good to go.

function scroll() {
    var speed:Number = 10;
    if(direction == "up") {
        if(bio_txt._y - speed + bio_txt._height > (startingY + bottom)) {
            bio_txt._y -= speed;
        } else {
            bio_txt._y = (startingY + bottom) - bio_txt._height;
        }
    } else if(direction == "down") {
        if(bio_txt._y + speed < startingY) {
            bio_txt._y += speed;
        } else {
            bio_txt._y = startingY;
        }
    }
}

var scrollButtonPressed:Boolean = false;

down_btn.onPress = function() {
    scrollButtonPressed = true;
    direction = "down";
};

down_btn.onRelease = function() {
    scrollButtonPressed = false;
}

up_btn.onPress = function() {
    scrollButtonPressed = true;
    direction = "up";
};

up_btn.onRelease = function() {
    scrollButtonPressed = false;
}

this.onEnterFrame = function() {
    if (scrollButtonPressed) {
        scroll();
    }
};

Peace
Mike
 
Old December 1st, 2004, 08:22 PM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks guys, I'll look into all your replies. I was really hoping not to have to use Flash, because Flash and I have a hate/hate relationship ( I hate using it and I'm pretty sure it hates me too....lol)









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.