Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    1
    Thanks
    0
    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:
    Code:
    {embed="Includes/header"}
    
    <script type="text/javascript" src="/js/cycle.js"></script>
    <script>
    function gototop(){
    $('body,html').scrollTop(0);
    
    }
    
    $(function(){
    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');
    } 
    }); 
    
    i=0;
    $container.children().each(function(i) { 
        // create input 
        var text = $(this).children('h3').text();
        $("<li><a>"+text+"</a></li>") 
            // append it to button container 
            .appendTo(bc) 
            // bind click handler 
            .click(function() { 
                // cycle to the corresponding slide 
                $container.cycle(i); 
                //return false; 
            }); 
    
    
    z=0;
    $('#quiz_container div').each(function(z){
    
                $(this).children('.btn').click(function() { 
                // cycle to the corresponding slide 
    
                $container.cycle(z); 
               
            });
      z++;
            }); 
    });
    
    });
    
    </script>
    
    
    {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">
        
        <h1>{title}</h1>
    <p>Course information written by: <b>{presenter}</b></p>    
    
    
        {course_body}
    
    <? $quizlink = "{quiz_link}"; ?>
    
    {if course_type =="Video"}
    
    <?
    $mod = "{module_notes}";
    ?>
    <script>
    
    $(function(){
    $('#quiz_container').append('<p><a href="<? echo $mod; ?>">Click here</a> to download notes from the module.</p>');
    });
    </script>
    {/if}
    
    {/exp:channel:entries}
        <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"  }
    <div>    
    <h3>{title}</h3>
    
        {chapter}
    
    {if absolute_count == total_results}
    <a class="btn" href="<? echo $quizlink; ?>" target="_blank" >Take the Quiz <i class="icon-caret-right"></i></a>
    {if:else}
    <a href="javascript:gototop();" class="btn" >Next <i class="icon-caret-right"></i></a>
    
    {/if}
    
    
    </div>
    <? $i++; ?>
    {/exp:channel:entries}
    
        </div
                </div>
    
        </div>
        <!--     /MAIN CONTENT -->
        
        
        </div>
        <!-- /PAGE CONTAINER -->
        
    
        {embed="Includes/footer"}
        
        
            <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>
            </div>
        </body>
    </html>
    TIA!!
    Last edited by VIPStephan; 05-20-2014 at 09:38 AM. Reason: corrected code BB tags

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    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
    •