www.webdeveloper.com
Results 1 to 6 of 6

Thread: a slide show exclusively for text attached to css , any ideas ?

  1. #1
    Join Date
    May 2012
    Posts
    9

    a slide show exclusively for text attached to css , any ideas ?

    i'm looking for a slide show exclusively for text attached to css / that plays constantly / but with image files for the "back", "stop" & "forward" buttons.

    I've searched for 3 days for something practical for a slide show that could be practical for a text scenario exclusively. What I've found were mostly javascript slide show's that were mainly for images & i'm not experienced enough to modify them for text attached to css.

    the scenario im currently stuck with is 4 paragraphs in a div css overflow... not going to fly ascetically or in a appealing sense for my targeted audience.

    **the scenario i'm hoping to have, is for * 4 paragraphs ( 4 layers in the ss, preferably DIV tags so i can add css on a external style sheet) * have the slide show perpetually playing * image files on the left and right for " back " & "forward " buttons.* and a image file on the bottom for a " stop" button *

    if someone could give me a functional code & to educated me on where in the HTML to insert each portion of the code i'd greatly appreciate it , I've been searching since Thursday and here i am still looking on a Saturday morning !

    o yea , i guess i could do this in fireworks but the only option i see is for FLASH & i don't want to go that route . i JUST DOWNLOADED adobe EDGE , maybe i experiment with this... i was hoping for JavaScript of something similar THANKS!

  2. #2
    Join Date
    Nov 2010
    Posts
    1,276
    something like this..?

    Code:
    <html>
    <head>
    </head>
    <style>
    .left{display:inline}
    </style>
    <body>
    <input type="button" value="<" onclick="move('down')" class="left"/>
    <div id="results" class="left">this is paragraph one</div>
    <input type="button" value=">" onclick="move('up')" class="left"/><br>
    <input type="button" value="stop" onclick="pause()" />
    <script type="text/javascript">
    var paras=["this is paragraph one", "...and paragraph two", "followed by paragraph three", "and paragraph four"];
    function move(dir){
    if(timer){clearTimeout(timer)}
    if(dir=="down"){
    paras.unshift(paras.pop())
    } if(dir=="up"){
    paras.push(paras.shift())
    
    }
    timer=setTimeout(function (){move(dir)}, 2000)
    document.getElementById("results").innerHTML=paras[0];
    }
    var timer=setTimeout(function (){move("up")}, 2000)
    
    function pause(){
    clearTimeout(timer);
    }
    </script>
    
    </body>
    </html>

  3. #3
    Join Date
    May 2012
    Posts
    9

    resolved

    @xelawho THANK YOU !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  4. #4
    Join Date
    May 2012
    Posts
    9

    Thumbs up

    Quote Originally Posted by xelawho View Post
    something like this..?

    Code:
    <html>
    <head>
    </head>
    <style>
    .left{display:inline}
    </style>
    <body>
    <input type="button" value="<" onclick="move('down')" class="left"/>
    <div id="results" class="left">this is paragraph one</div>
    <input type="button" value=">" onclick="move('up')" class="left"/><br>
    <input type="button" value="stop" onclick="pause()" />
    <script type="text/javascript">
    var paras=["this is paragraph one", "...and paragraph two", "followed by paragraph three", "and paragraph four"];
    function move(dir){
    if(timer){cleartimeout(timer)}
    if(dir=="down"){
    paras.unshift(paras.pop())
    } if(dir=="up"){
    paras.push(paras.shift())
    
    }
    timer=settimeout(function (){move(dir)}, 2000)
    document.getelementbyid("results").innerhtml=paras[0];
    }
    var timer=settimeout(function (){move("up")}, 2000)
    
    function pause(){
    cleartimeout(timer);
    }
    </script>
    
    </body>
    </html>
    thank you !!!!!!!!!!!!!!!!!!!!!!!

  5. #5
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,709
    can be used for Divs or images

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <style type="text/css">
    /*<![CDATA[*/
    
    .parent {
      position:relative;left:200px;top:200px;width:200px;height:110px;border:solid red 1px;
    }
    
    .div {
      position:relative;width:200px;height:100px;background-Color:#FFFFCC;border:solid red 1px;float:left;
    }
    
    /*]]>*/
    </style></head>
    
    <body>
    
     <div id="tst" class="parent" onmouseover="S1.Pause();" onmouseout="S1.Auto();" >
      <div class="slide" >
       <div class="div" >0</div>
       <div class="div" >1</div>
       <div class="div" >2</div>
       <div class="div" >3</div>
      </div>
     </div>
    <input type="button" name="" value="Auto" onmouseup="S1.Auto();" />
    <input type="button" name="" value="Pause" onmouseup="S1.Pause();" />
    <input type="button" name="" value="Forward" onmouseup="S1.Step(-1);" />
    <input type="button" name="" value="Back" onmouseup="S1.Step(1);" />
     <div id="tstV" class="parent" onmouseover="S2.Pause();" onmouseout="S2.Auto();" style="left:800px;" >
      <div class="slide" >
       <div class="div" >0</div>
       <div class="div" >1</div>
       <div class="div" >2</div>
       <div class="div" >3</div>
      </div>
     </div>
    
    
    
    <script type="text/javascript">
    /*<![CDATA[*/
    // DIV Slide Show  (13-May-2012)
    // by Vic Phillips - http://www.vicsjavascripts.org.uk/
    
    function zxcDIVSlideShow(o){
     var oop=this,mde=o.Mode,mde=typeof(mde)=='string'&&mde.charAt(0).toUpperCase()=='V'?['top','left','height','offsetTop','offsetHeight']:['left','top','width','offsetLeft','offsetWidth'],p=document.getElementById(o.ID),slide=p.getElementsByTagName('DIV')[0],clds=slide.childNodes,ary=[],lft,sz,clode,ms=o.SlideDuration,hold=o.HoldDuration,srt=o.AutoStart,z0=0;
     p.style.overflow='hidden';
     slide.style.position='absolute';
     slide.style[mde[2]]='30000px';
     for (;z0<clds.length;z0++){
      if (clds[z0].nodeType==1){
       lft=clds[z0][mde[3]];
       ary.push(lft);
       sz=lft+clds[z0][mde[4]];
      }
     }
     slide.style[mde[2]]=sz+5+'px';
     clone=slide.cloneNode(true);
     clone.style[mde[1]]='0px';
     clone.style[mde[0]]=sz+'px';
     slide.appendChild(clone);
     clone=clone.cloneNode(true);
     clone.style[mde[0]]=-sz+'px';
     slide.appendChild(clone);
     oop.mde=mde[0];
     oop.obj=slide;
     oop.ary=ary;
     oop.sz=sz;
     oop.ms=typeof(ms)=='number'?ms:1000;
     oop.hold=typeof(hold)=='number'?hold:oop.ms*2;
     oop.cnt=0;
     oop.ud=-1;
     oop.now=0;
     if (typeof(srt)=='number'){
      oop.Auto(srt);
     }
    }
    
    zxcDIVSlideShow.prototype={
    
     Step:function(ud,auto){
      ud=typeof(ud)=='number'?ud>0?1:-1:-1;
      var oop=this,ary=oop.ary,cnt=this.cnt+ud;
      oop.Pause();
      if (typeof(ary[cnt])!='number'){
       oop.now+=oop.sz*(ud>0?-1:1);
       cnt=ud>0?0:ary.length-1;
      }
      oop.ud=ud;
      oop.auto=auto===true;
      oop.cnt=cnt;
      clearTimeout(oop.dly);
      oop.animate(oop.mde,oop.now,ary[cnt],new Date(),this.ms);
     },
    
     Auto:function(ms){
      var oop=this;
      oop.Pause();
      oop.to=setTimeout(function(){ oop.Step(oop.ud,true); },ms||500);
     },
    
     Pause:function(){
      this.auto=false;
      clearTimeout(this.to);
     },
    
     animate:function(mde,f,t,srt,mS){
      var oop=this,ms=new Date().getTime()-srt,now=(t-f)/mS*ms+f;
      if (isFinite(now)){
       oop.now=now;
       oop.obj.style[mde]=now+'px';
      }
      if (ms<mS){
       oop.dly=setTimeout(function(){ oop.animate(mde,f,t,srt,mS); },10);
      }
      else {
       oop.now=t;
       oop.obj.style[mde]=t+'px';
       if (oop.auto){
        oop.Auto(oop.hold);
       }
      }
     }
    
    }
    
    S1=new zxcDIVSlideShow({
     ID:'tst',            // the unique ID name of the parent node.                       (string)
     Mode:'horizontal',   //(optional) the mode of execution, 'horizontal' or 'vertical'. (string, default = 'horizontal')
     SlideDuration:1000,  //(optional) the slide duration in milli seconds.               (number, default = 1000)
     HoldDuration:1000,   //(optional) the auto rotation hold duration in milli seconds.  (number, default = SlideDuration*2)
     AutoStart:1000       //(optional) the auto rotation start duration in milli seconds. (number, default = no auto start)
    });
    
    
    S2=new zxcDIVSlideShow({
     Mode:'vertical',
     ID:'tstV',
     AutoStart:1000
    });
    
    /*]]>*/
    </script>
    </body>
    
    </html>
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  6. #6
    Join Date
    May 2012
    Posts
    9

    Thumbs up

    Quote Originally Posted by vwphillips View Post
    can be used for Divs or images

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <style type="text/css">
    /*<![CDATA[*/
    
    .parent {
      position:relative;left:200px;top:200px;width:200px;height:110px;border:solid red 1px;
    }
    
    .div {
      position:relative;width:200px;height:100px;background-Color:#FFFFCC;border:solid red 1px;float:left;
    }
    
    /*]]>*/
    </style></head>
    
    <body>
    
     <div id="tst" class="parent" onmouseover="S1.Pause();" onmouseout="S1.Auto();" >
      <div class="slide" >
       <div class="div" >0</div>
       <div class="div" >1</div>
       <div class="div" >2</div>
       <div class="div" >3</div>
      </div>
     </div>
    <input type="button" name="" value="Auto" onmouseup="S1.Auto();" />
    <input type="button" name="" value="Pause" onmouseup="S1.Pause();" />
    <input type="button" name="" value="Forward" onmouseup="S1.Step(-1);" />
    <input type="button" name="" value="Back" onmouseup="S1.Step(1);" />
     <div id="tstV" class="parent" onmouseover="S2.Pause();" onmouseout="S2.Auto();" style="left:800px;" >
      <div class="slide" >
       <div class="div" >0</div>
       <div class="div" >1</div>
       <div class="div" >2</div>
       <div class="div" >3</div>
      </div>
     </div>
    
    
    
    <script type="text/javascript">
    /*<![CDATA[*/
    // DIV Slide Show  (13-May-2012)
    // by Vic Phillips - http://www.vicsjavascripts.org.uk/
    
    function zxcDIVSlideShow(o){
     var oop=this,mde=o.Mode,mde=typeof(mde)=='string'&&mde.charAt(0).toUpperCase()=='V'?['top','left','height','offsetTop','offsetHeight']:['left','top','width','offsetLeft','offsetWidth'],p=document.getElementById(o.ID),slide=p.getElementsByTagName('DIV')[0],clds=slide.childNodes,ary=[],lft,sz,clode,ms=o.SlideDuration,hold=o.HoldDuration,srt=o.AutoStart,z0=0;
     p.style.overflow='hidden';
     slide.style.position='absolute';
     slide.style[mde[2]]='30000px';
     for (;z0<clds.length;z0++){
      if (clds[z0].nodeType==1){
       lft=clds[z0][mde[3]];
       ary.push(lft);
       sz=lft+clds[z0][mde[4]];
      }
     }
     slide.style[mde[2]]=sz+5+'px';
     clone=slide.cloneNode(true);
     clone.style[mde[1]]='0px';
     clone.style[mde[0]]=sz+'px';
     slide.appendChild(clone);
     clone=clone.cloneNode(true);
     clone.style[mde[0]]=-sz+'px';
     slide.appendChild(clone);
     oop.mde=mde[0];
     oop.obj=slide;
     oop.ary=ary;
     oop.sz=sz;
     oop.ms=typeof(ms)=='number'?ms:1000;
     oop.hold=typeof(hold)=='number'?hold:oop.ms*2;
     oop.cnt=0;
     oop.ud=-1;
     oop.now=0;
     if (typeof(srt)=='number'){
      oop.Auto(srt);
     }
    }
    
    zxcDIVSlideShow.prototype={
    
     Step:function(ud,auto){
      ud=typeof(ud)=='number'?ud>0?1:-1:-1;
      var oop=this,ary=oop.ary,cnt=this.cnt+ud;
      oop.Pause();
      if (typeof(ary[cnt])!='number'){
       oop.now+=oop.sz*(ud>0?-1:1);
       cnt=ud>0?0:ary.length-1;
      }
      oop.ud=ud;
      oop.auto=auto===true;
      oop.cnt=cnt;
      clearTimeout(oop.dly);
      oop.animate(oop.mde,oop.now,ary[cnt],new Date(),this.ms);
     },
    
     Auto:function(ms){
      var oop=this;
      oop.Pause();
      oop.to=setTimeout(function(){ oop.Step(oop.ud,true); },ms||500);
     },
    
     Pause:function(){
      this.auto=false;
      clearTimeout(this.to);
     },
    
     animate:function(mde,f,t,srt,mS){
      var oop=this,ms=new Date().getTime()-srt,now=(t-f)/mS*ms+f;
      if (isFinite(now)){
       oop.now=now;
       oop.obj.style[mde]=now+'px';
      }
      if (ms<mS){
       oop.dly=setTimeout(function(){ oop.animate(mde,f,t,srt,mS); },10);
      }
      else {
       oop.now=t;
       oop.obj.style[mde]=t+'px';
       if (oop.auto){
        oop.Auto(oop.hold);
       }
      }
     }
    
    }
    
    S1=new zxcDIVSlideShow({
     ID:'tst',            // the unique ID name of the parent node.                       (string)
     Mode:'horizontal',   //(optional) the mode of execution, 'horizontal' or 'vertical'. (string, default = 'horizontal')
     SlideDuration:1000,  //(optional) the slide duration in milli seconds.               (number, default = 1000)
     HoldDuration:1000,   //(optional) the auto rotation hold duration in milli seconds.  (number, default = SlideDuration*2)
     AutoStart:1000       //(optional) the auto rotation start duration in milli seconds. (number, default = no auto start)
    });
    
    
    S2=new zxcDIVSlideShow({
     Mode:'vertical',
     ID:'tstV',
     AutoStart:1000
    });
    
    /*]]>*/
    </script>
    </body>
    
    </html>
    man ! i'm seriously honored you provided me with this! if i was actually making money off my LLC i'd ask for your pay pal so i could compensate you in some way . thank you very much !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.15147 seconds
  • Memory Usage 2,930KB
  • Queries Executed 15 (?)
More Information
Template Usage (34):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (73):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates