Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Small HTML Bug  (Read 3680 times)

0 Members and 1 Guest are viewing this topic.
Small HTML Bug
« on: April 16, 2014, 09:39:56 pm »
  • *
  • Reputation: +2/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2376
I have been learning how to make websites and was able to make one, yet I got into a bug that involves FlexSlider, I have to add multiple flexsliders one in each accordion, everything looks fine, yet the slider doesn't work all the time, it seems that the hidden attribute of the accordion is messing with it, the website is: http://iplagunera.com/modelos.html the first two accordions have flexslider, sometimes it works sometimes it doesn't, the code I'm using is the following:

Quote
<div class="accordion">
            <div class="accord_cont">
                <div class="flexslider">
                    <ul class="slides">
                        <li>
                        <img src="./index2_files/sa/1.jpg" alt="">
                        </li>
                        <li>
                        <img src="./index2_files/sa/2.jpg" alt="">
                        </li>
                    </ul>
                </div>
            </div>
</div>
While the Jscript code is the following:

Quote
<!-- CALL FLEX SLIDER -->
<script>
      $(".accordion h3").click(function(){
        $('.flexslider').flexslider({
        pauseOnHover: false,   
        slideshow: true,     
        slideshowSpeed: 4000
        animationSpeed: 1300,
        animation: "slide",
        easing: "swing",
        direction: "horizontal",
        controlNav: false,
        directionNav: true
        });
      });
</script>   
<!-- CALL ACCORDION -->
<script>
    $(".accordion h3").eq(0).addClass("active");
    $(".accordion .accord_cont").eq(0).show();
    $(".accordion h3").click(function(){
        $(this).next(".accord_cont").slideToggle("slow")
        .siblings(".accord_cont:visible").slideUp("slow");
        $(this).toggleClass("active");
        $(this).siblings("h3").removeClass("active");
    });
</script>
I'm pretty sure it's something simple, like the accordion loading at the same time as the flexslider, while it should be first the accordion and once loaded the flexslider, so zfgc any help D:?
Logged

AJAX

Re: Small HTML Bug
« Reply #1 on: April 18, 2014, 12:59:57 pm »
Okay, this is easy. I don't know why this person is adding and removing that <h3>. I would suggest removing that code and adding in a <div class="button"> within accordion or something.

I'm not sure how this accordion tool works. It looks a bit convoluted.
Logged
Re: Small HTML Bug
« Reply #2 on: April 21, 2014, 10:53:54 am »
  • The Dark Lord is here...
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 29
It's not an HTML error but a Javascript error, you have the Javascript functions calling ".accordion h3" elements, when they should be calling ".accordion img".
Logged
Darth RPG - Feel Dark Side temptation

  • The Legend of Cerda Website

AJAX

Re: Small HTML Bug
« Reply #3 on: April 21, 2014, 04:43:51 pm »
Oh damn, didn't see that!

    $(".accordion h3").eq(0).addClass("active");
    $(".accordion .accord_cont").eq(0).show();

^^ my bad. What an odd.. way of doing this, though?
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.038 seconds with 42 queries.