Results 1 to 4 of 4

Thread: Blending Image Slide Show & Chrome...

  1. #1
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Blending Image Slide Show & Chrome...

    1) Script Title: Blending Image Slide Show-no chrome.

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/image4.htm

    3) Describe problem: I'm using the script on www.pastoralia.co.il index page. when I use Chrome and the page loads as index.htm default page of the website, the page dosn't load and stops at the slideshow. the css validats well but the html has the onload <body> tag problem and two more problems related to the slide show js. the intresting point is that if I load the index page from a inside the website it loads fine and the slidshow runs well?! what am I missing?
    Iland

  2. #2
    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

    You left out the closing HTML comment delimiter in the second script for the slide show (opening delimiter highlighted, missing closing delimiter inserted - highlighted and red):

    Code:
    <script type="text/javascript" language="JavaScript1.1">
    <!--
    
    var whichlink=0
    var whichimage=0
    var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
    function slideit(){
    if (!document.images) return
    if (ie) document.images.slide.filters[0].apply()
    document.images.slide.src=imageholder[whichimage].src
    if (ie) document.images.slide.filters[0].play()
    whichlink=whichimage
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    setTimeout("slideit()",slidespeed+blenddelay)
    }
    slideit()
    
    // -->
    </script>
    However, it's safest to get rid of all such opening and closing HTML comment delimiters in all script and style blocks. They are no longer needed to 'hide from older browsers' (these older browsers just aren't around any longer) and could potentially get your styles and/or scripts ignored by some newer browsers.
    - John
    ________________________

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

  3. #3
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Thanks, it works!
    I don't understand why... but it works!

  4. #4
    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

    It works because once you have an opening HTML comment delimiter:

    Code:
    <!--
    unless or until there is a closing one:

    Code:
    -->
    the browser 'is within its rights' to ignore all that follows as a comment.

    Most browsers these days will error correct that if you open a comment in a script tag and neglect to close it before the end of the tag, apparently not Chrome.

    However, with browsers continually updating, there will come a time when perhaps all that is within these delimiters will be ignored (that's their strict meaning, regardless of where they appear). If so, older scripts like this one that use them will be ignored by those browsers unless both the opening and closing delimiters are removed (well really just the opening ones, but then there is no need for the closing ones).
    - 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
  •