Results 1 to 5 of 5

Thread: Add dropdown to news ticker...

  1. #1
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Add dropdown to news ticker...

    Hi there,

    I have used the following script to put a news ticker on my page:

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

    Does any body know how I could add a dropdown box that would allow users to "skip" to a specific ticker entry?


    I tried adding variations of the following to the ajaxticker.js file:
    Code:
    function statsSelect() {
    var statsindex = document.statsForm.SelectedArea.selectedIndex
    this.pointer = statsindex;
    }
    ... and then calling it via OnChange on my dropdown field/form. No luck. I am a Javascript newbie who has stepped beyond his ability here!

    Does anybody know how I could achieve this?

    Any help is VERY much appreciated!

    Cheers,

    Stanbridge

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm it's certainly possible, but what do you intend to display within each OPTION's text value to indicate the message it corresponds to? Also, upon jumping to a certain message, did you want the ticker to stop rotating from thereon?

  3. #3
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I work for some property research people. They maintain a list of statistical figures for different Cities.

    I was planning to use the news ticker more as a statistics ticker - that is, it will roll through a preset list of statistics.

    So bascially the "tickercontent.txt" file is going to be a fixed set of data (stats for each City). The options in the dropdown will refer to each set of statistics stored in the <message> divs in tickercontent.

    Theoretical Example:

    Dropdown
    CityA = message[0]
    CityB = message[1]
    CityC = message[2]
    CityD = message[3]


    After jumping to a specific message, it would be good if the ticker could pause there and then continue rotating again.

    Ideally, the pause would be longer than the usual pause between rotations but if it's too much extra work to make "jumped-to" messages have their own pause time, the normal pause time would suffice.

    Any ideas? Is this difficult?

    Cheers!

    Stanbridge

  4. #4
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    *bump*


    Wow, that was my first time. I've never "bumped" before.

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sorry for the delay. Ok, try the attached modified ajaxticker.js. Then, on your page, you would have something like the below:

    Code:
    <script type="text/javascript">
    
    var xmlfile="tickercontent.txt" //path to ticker txt file on your server.
    
    //ajax_ticker(xmlfile, divId, divClass, delay, optionalfadeornot)
    var myticker=new ajax_ticker(xmlfile, "ajaxticker1", "someclass", 3500, "fade")
    myticker.adddropdown("dropdown", "City ")
    </script>
    
    <div id="dropdown"></div>
    Notice the part in red, which is new from the default set up. Basically, create a blank div to house the drop down, give it an ID, and pass that into adddropdown(). The second parameter ("City") btw should be the prefix you wish to show in each OPTION's displayed text.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •