Results 1 to 10 of 10

Thread: Pausing up-down message scroller Show 2 Messegs!? Simple

  1. #1
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pausing up-down message scroller Show 2 Messegs!? Simple

    Hi guys :
    i really like this script and the only problem i have is that i like to change the number of messeges that shows at one , for example i like to show 3 messegs at once and not 1 by one as it in the original script .
    link to the original script :
    http://www.dynamicdrive.com/dynamicindex2/crosstick.htm
    thanks for your help by adavnced .

  2. #2
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    You are in the wrong location.

    Be sure to use the proper format. thread

    I didn't find any answers, best luck with dd.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Just use three messages per item in the code. If I remember correctly the message array looks something like this:

    Code:
    messages[0]="Some message"
    messages[1]="Another message"
    messages[2]="Yet another message"
    If you want the first three to be one:

    Code:
    messages[0]="<p>Some message</p><p>Another message</p><p>Yet another message</p>"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow

    first thanks allot for your help , but thats not the good way to do it ( for me ofcourse ) cause i use database and i get my messeges from database and show them by loop inside the java script , i just looking for the parameter that actually changing the way of the showing messeges , so in this cause if the message 0 and message 1 and message 3 and message 4 comes from the databse the java scrip know that he has to show only the first 2 ( message[0] and message[1] ) and then message3 and 4 .
    if you can help me out over here with this small change i will really approciate it .

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What happened to messages[2]? Anyways, I don't see what the problem is. Concatenate the database supplied text(s) as you wish before you assign them a value of messages[x].
    Last edited by jscheuer1; 07-05-2005 at 09:19 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Quote Originally Posted by jscheuer1
    What happened to messages[2]? Anyways, I don't see what the problem is. Concatenate the database supplied text(s) as you wish before you assign them a value of messages[x].
    i just gave you a example jhone about messages it's seems that i forget about the message[2], my loop generates the number from 0 to the end of the database which can be 10 or 100 messages, now if you understand in asp codes you see that i take 1 line of the javascrip and loop the one line with content of the database so the loop starts from 0 and i just can Concatenate the messages cause i ahve no control on the messeges , there must be some parameter that decide how many messages to show per cycle , exactly like the high or the backgroud color .
    thanks for your time .
    Dave
    Last edited by davidr; 07-05-2005 at 10:03 AM.

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't know ASP, but I'm sure it's capable of concatenating three messages into one before assigning them into the array.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    May 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    I don't know ASP, but I'm sure it's capable of concatenating three messages into one before assigning them into the array.
    Twey , belive me that this wonderful script must have this parameter , it make sens don't you think so ?

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well... no, not really.
    In ordinary circumstances the webmaster can just manually concatenate the messages, as suggested by John, and in more complex usage with a server-side script, the server-side script can be made to do it. There's not really any point.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, there is no parameter like that. The messages get parceled out for inclusion into two different html elements that chase each other in the scroller. The order would get jumbled up and include repetitions if we started assigning two of them to this multipart operation. If it is possible to run a few lines of javascript after the message array has been created and before the rest of the script executes, here are the lines to run:

    Code:
    var count=0, lb=ie? "<br>" : ""
    for (m = 0; m < messages.length; m+=2){
    if ((messages[m]!==undefined)&&(messages[m+1]!==undefined))
    messages[count]=lb+'<p>'+messages[m]+'</p><p>'+messages[m+1]+'</p>'
    else if (messages[m]!==undefined)
    messages[count]=lb+'<p>'+messages[m]+'</p>'
    count++
    }
    
    var messL=messages.length
    for (i = count; i < messL; i++)
    messages.pop()
    For example, in the demo version for this script that I used for testing, I put the above code right after where it says:
    Code:
    var ie=document.all
    var dom=document.getElementById
    and it worked fine. I also had to adjust the 'scrollerheight' variable to make the scroller tall enough to accommodate the new height of each, now taller, message (increasing the scrollerwidth would work as well, in many cases). If I didn't do that, the messages would overlap. What this does is to rewrite the array putting two messages in the place of one for each entry and remove the excess entries.
    Last edited by jscheuer1; 07-05-2005 at 11:35 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •