Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2014
    Thanked 0 Times in 0 Posts

    Modifying text link makes button above inactive

    Hi there--

    I need to have two versions of a template. One has a "quiz button" WITH a "download module" link, and one with just the "quiz button". Every time I try to modify the "download module" code, it makes the "quiz button" inactive. Any thoughts on what is causing this / how I can modify one w/o affecting the other? Here's what I'm working with:
    <script type="text/javascript" src="/js/cycle.js"></script>
    function gototop(){
    var bc = $('#buttonContainer'); 
    var $container = $('#quiz_container').cycle({ 
        fx:     'scrollHorz', 
        speed:   300, 
        timeout: 0,
        after: function (curr, next, opts) {
    $('.navidentifyb li').removeClass('active');
       $('.navidentifyb li').eq(opts.currSlide).addClass('active');
    $container.children().each(function(i) { 
        // create input 
        var text = $(this).children('h3').text();
            // append it to button container 
            // bind click handler 
            .click(function() { 
                // cycle to the corresponding slide 
                //return false; 
    $('#quiz_container div').each(function(z){
                $(this).children('.btn').click(function() { 
                // cycle to the corresponding slide 
    {exp:channel:entries channel="CE_Courses" limit="1"}    
    <div id="headerpromo"><img src="{course_header}" alt="About Putney" /></div>
        <!--     PAGE CONTAINER -->
        <div id="pagebody">
        {embed="Sidebars/education" id="205" }
        <!-- MAIN CONTENT -->
        <div id="content">
    <p>Course information written by: <b>{presenter}</b></p>    
    <? $quizlink = "{quiz_link}"; ?>
    {if course_type =="Video"}
    $mod = "{module_notes}";
    $('#quiz_container').append('<p><a href="<? echo $mod; ?>">Click here</a> to download notes from the module.</p>');
        <div id="quiz_container">
    <? $i = 0; ?>
      {exp:channel:entries channel="course_chapters" sort="asc" orderby="chapter_number" related_categories_mode="yes"  limit="100" custom_fields="yes"  }
    {if absolute_count == total_results}
    <a class="btn" href="<? echo $quizlink; ?>" target="_blank" >Take the Quiz <i class="icon-caret-right"></i></a>
    <a href="javascript:gototop();" class="btn" >Next <i class="icon-caret-right"></i></a>
    <? $i++; ?>
        <!--     /MAIN CONTENT -->
        <!-- /PAGE CONTAINER -->
            <div id="promos">
                <a href="/howtobuy"><div class="promo">How to Buy</div></a>
                <a href="/vetsignup"><div class="promo">Veterinarian Sign Up</div></a>
                <a href="/whyputney"><div class="promo">Why Putney Generics</div></a>
    Last edited by VIPStephan; 05-20-2014 at 10:38 AM. Reason: corrected code BB tags

  2. #2
    Senior Coder
    Join Date
    Dec 2010
    Thanked 570 Times in 563 Posts
    Please change < code > to [ code ] (without the spaces) to format/indent your code example correctly


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