Results 1 to 8 of 8

Thread: Swiss Army Image Slideshow

  1. #1
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thank you for a great script. I have two question:

    1. Is it possible to edit the text for the image counter?
    Now it says "Viewing image: 1 of 4". I would like it to display just 1 : 4

    2. I'm stuck here, why does this happend? In IE 7 I miss space after 1: 4 when I run the script locally. When I run the script online, it works just fine. Why?

    Hope you can give me an answer for this.

    Regards

  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

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.


    Find this function in the script:

    Code:
    inter_slide.prototype.cntrl=function(){
    this.cpad=this.imgs.length.toString().length;
    document.write('<div align="center">Viewing Image: <b><span id="thecnt'+this.issid+'"><\/span><\/b> of<span style="font-size:1ex;">&nbsp;</span>&nbsp;<b>'+this.imgs.length+'<\/b><\/div>');
    }
    You can plainly see where the:

    Viewing Image: 1 of 4

    is coming from. Using a plain text editor, you can change those words to whatever you prefer.

    As far as your second question goes, I cannot be sure. As long as it looks OK online, why worry? However, if after making your page live, there is still a problem, perhaps you need to use a valid URL DOCTYPE like:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    with your page. If you need more help:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  3. #3
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Script: Swiss Army Image Slideshow
    http://www.dynamicdrive.com/dynamici...army/index.htm

    Like this I hope. Thank you for making me aware of this. Sorry.

    First of all, thank you for a quick response.
    Yes, I found the line of code for editing.
    I still have this "bug" for lack of space after the first number.
    You can see it live here.

    Nano

  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

    OK, you have an older, developer copy of the main script:

    Code:
    <script src="sai_ss.js" type="text/javascript"></script>
    Use the release version from the demo page instead. It is called swissarmy.js and may be copied/saved from this link:

    http://www.dynamicdrive.com/dynamici...y/swissarmy.js

    or from the demo page.
    - John
    ________________________

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

  5. #5
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Ok! I have copied the right code, both html and the .js file, but it didn't do much of a difference. Updated link to the site.

    The problem for me is only in IE 7. The strange part here is that the posted script workes fine in IE 7. I don't understand what is wrong here.
    Any ideas what causes this? I think it's really weird.

    Nano

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

    There is something going on with your server. The only difference I can find so far in the way these two files are being served is in their byte size. The one on your server reports as:

    18051 bytes

    The one on Dynamic Drive's server reports as:

    17630 bytes

    However, if I navigate directly to them and copy them to a text editor and compare them, they are reported as identical.

    Ah, I just tried comparing their generated source from the two servers. These vary and at the exact line where this is happening. If you change:

    Code:
    <\/span><\/b> of<span style="fon
    to:

    Code:
    <\/span><\/b>&nbsp;of<span style="fon
    it should take care of it. I have no idea why your server is doing that, and it should actually result in a smaller served size from your server, not a larger one, but hey, let's see what happens. Even just according to the rules of HTML, using the non-breaking space entity there should be more certain of guaranteeing that the space is rendered.
    - John
    ________________________

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

  7. #7
    Join Date
    Nov 2007
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I'm going to call my webhost tomorrow and ask them why this is.
    Anyway, our tip took care of the problem, have a look.

    I'm not a tech guy. You are! Thanks John for all your help.

    Nano

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

    I wouldn't be too hard on your host, the script should be updated, as having the entity there won't hurt anything, and if it helps in the odd situation like you have just experienced, why not? The only problem is, though it is my code, I don't have the access to make even such a simple update on the DD server. While at the same time, the one person who does shouldn't really be bothered with such a minor change. That (access for me) may be coming though.

    Alternatively, I have plans for that script. I would like to rewrite it, adding in more style hooks and optional properties to make customization by intermediate and advanced designers easier, and to just generally tighten up the code. Once I do that, it will be worth bothering DD about updating it. I just hope I remember this issue when that time comes.
    - 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
  •