Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: problem with modified Ultimate Fade-in slideshow

  1. #1
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default problem with modified Ultimate Fade-in slideshow

    hi!

    i've modified the Ultimate Fade-in slideshow 1.5 quite much to satisfy my needs.
    i've changed so that any content can be shown (not just images) and i've also created an ajax functionality which updates the array of content automaticly.

    my url:
    http://www2.hemsida.net/badtant/test/index.html

    first i specify the content to be in the slide like this (shout0 and shout1):
    <div id="shoutarray">
    <div id="shout0"><blockquote><div><p>If it sounds country, man, that's what it is: It's a country song!</p></div></blockquote><cite><a href="/badtant" class="member-image" title="badtant is online. View profile."><img src="http://alias.passagen.se.stage.sol.basefarm.net/images/c4/ca/c4ca4238a0b923820dcc509a6f75849b/e914a1625a57cce9b1642926ccfea42e_125x125.jpg" alt="" /></a><span class="online-status online"><a href="metropol_member_view.shtml" title="badtant is online. View profile.">1 badtant</a></span></cite></div>
    <div id="shout1"><blockquote><div><p>Vinden vilar</p></div></blockquote><cite><a href="/Liliss_234" class="member-image" title="Liliss_234 is online. View profile."><img src="http://alias.passagen.se.stage.sol.basefarm.net/images/1f/0e/1f0e3dad99908345f7439f8ffabdffc4/881fa3ea209bb22f7dffe2cf78681880_125x125.jpg" alt="" /></a><span class="online-status offline"><a href="metropol_member_view.shtml" title="Liliss_234 is offline. View profile.">2 Liliss_234</a></span></cite></div>
    </div>

    the content is later read into my js array "shoutcast" with the function updateShoutArray (available in shoutbox.js)

    then the fadeshow is created as usual with:
    new fadeshow(shoutcast, 4000, 0);

    --------------

    when it all runs i have an ajax feature which updates the content every 30 seconds:
    onload="setInterval('getShouts()',30000);"

    getShouts (in ajax.js) updates the div shoutarray with new content and then cals the newShouts function (in shoutbox.js)
    now the file shoutsigen.html is read for new content (should later be replaced with a dynamic page).

    newShouts calls updateShoutArray (function was also was used earlier) that reads the new content and put it in the js array shoutcast.
    then changeShoutArray is called to put the new array into my slideshow.

    changeShoutArray was copied from this thread:
    http://www.dynamicdrive.com/forums/s...ead.php?t=8158

    --------------

    all this works great but there is one problem. because of missing functionality in velocity (http://jakarta.apache.org/velocity/) that i currently use, i can't put the first array of content that i want to use directly in the div called shoutarray (the first thing i explained). it has to be read from the same file (shoutsigen.html) that i later collect new content from.
    i've tried using SSI to include the file but SSI isn't supported here.

    there doesn't seem to be a way to include the content properly, at least i can't find any... does anybody have an idea?
    if not, maybe i can work around this problem somehow? but i really can't figure out how...

    any ideas of how to fix this problem would be great!
    i hope you can understand my explanation of how this thing i've created works =)

    here's a zip-file with all my files if you want to download an laborate with it:
    http://www2.hemsida.net/badtant/test/test.zip

    feel free to use it on your own sites too if you find it usefull =)

    thanks!!

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

    Default

    Does Velocity not include such a mechanism?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    there are the functions #parse and #include but neither seems to work.

    what i want is to include the content which my external page (shoutsigen.html in my example but should later be replaced with a dynamic page) renders out and neither did that... it just got empty. it works now when i'm including a plain html file but not when i'm trying with a dynamic page.
    Last edited by badtant; 04-26-2006 at 03:11 PM.

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

    Default

    there are the functions #parse and #include but neither seems to work.
    This is your real problem. I suggest you look into it -- you will need the help of someone who is familiar with Velocity.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well, the ones i know that know alot about velocity don't think it's possible... and i can't find any good forum for velocity. do you know one?

    another solution to work around this that i have thought about is to leave my shoutarray div empty at first and then run the ajax part directly when the page has loaded to get the content. and after that run updateShoutArray to build up my shoutcast array.
    this way i will get the content but the problem here is that i have to wait for this to finnish before i can start the fadeshow with new fadeshow(shoutcast, 4000, 0). and i don't know if that is possible since i think it has to be run like it runs now to get my fadeshow att the right place of my page. but maybe i'm wrong? any thoughts about that?

    thanks!

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

    Default

    I don't think so, no. I can't be sure, since you didn't link to the script in question, but I think it should be fine to call it from wherever you need to, since the first argument looks like an ID.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry, this is the script in question that i've modified:
    http://www.dynamicdrive.com/dynamici...nslideshow.htm

    the first argument is the array containing the content for the different slides.

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

    Default

    Ah -- you're right. It calls document.write():
    Code:
    document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
    else
    document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
    The way around this is to create the DIVs and things manually, and remove that code from the source.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah, that could work! i'll give it a try =)

  10. #10
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it works =) now i just have one last problem...

    here's the original code:

    Code:
    if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
    {
    document.write('<div id="master'+this.slideshowid+'" class="shoutlayer1">')
    document.write('<div id="'+this.canvasbase+'_0" class="shoutlayer2" style="filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;"></div>')
    document.write('<div id="'+this.canvasbase+'_1" class="shoutlayer2" style="filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;"></div>')
    document.write('<div id="shouthelp" class="shoutlayer2" style="display:none;z-index:1000;"></div>')
    document.write('</div>')
    }
    else
    document.write('<div id="defaultslide'+this.slideshowid+'">'+this.postimages[0]+'</div>')
    ----------

    i'm moving this from my js file out the the html file and i'm writing this:

    HTML Code:
    if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
    {
    document.write('<div id="master0" class="shoutlayer1">');
    document.write('<div id="canvas0_0" class="shoutlayer2" style="filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;"></div>');
    document.write('<div id="canvas0_1" class="shoutlayer2" style="filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;"></div>');
    document.write('<div id="shouthelp" class="shoutlayer2" style="display:none;">hjlp hjlp hjlp</div>');
    document.write('</div>');
    }
    else
    document.write('<div id="defaultslide0">'+this.postimages[0]+'</div>')
    the problem is the last row. what do i write instead of '+this.postimages[0]+'?

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
  •