Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript image slider

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #161725
    Gurprit Singh
    Participant

    Here is my code.I’m designing a website,where in the index page there should be image slider

    there will be a registration form on the image slider,I want that the slider images will slide but the form will not slide,it will be in it’s same position.

    But I can’t do that and I have no idea that how should I do that.

    Please help me out.Thanks in advance.

    #161726
    chrisburton
    Participant

    Please upload your code to CodePen

    #161728
    Gurprit Singh
    Participant
    #161735
    chrisburton
    Participant

    Do you have a live URL? Otherwise, where is your CSS and slider? Can you upload your images to something like Tinypic.com and replace the url in <img src="place URL here" />

    It is helpful when we see that you have put some effort into your issue. All I see here is just HTML.

    #161738
    Gurprit Singh
    Participant

    function swapImages(){
    
      var $active = $('#myGallery .active');
      var $next = ($('#myGallery .active').next().length &gt; 0) ? $('#myGallery .active').next() : $('#myGallery img:first');
      $('.active').fadeOut(function(){
      $('.active').removeClass('active');
      $next.fadeIn().addClass('active');
      });
    }
    
    $('document').ready(function(){
    
      // Run our swapImages() function every 5secs
      setInterval('swapImages()', 5000);
    });
    

    #myGallery{
    position:relative;
    width:400px;
    height:300px;
    }

    #myGallery img.active{
      display:block;
    }
    #form {
    width:200px; 
    height:200px; 
    background:yellow; 
    position:absolute; 
    bottom: 20px; 
    right: 20px}
    



    #161739
    Gurprit Singh
    Participant

    i want fade in and out very slow pls help me out

    #161741
    chrisburton
    Participant

    Please apply that code to the codepen, click save. Again, please upload your images to Tinypic and replace the URLS.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.