Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve 472 posts 1216 karma points
    Jun 30, 2015 @ 13:00
    Steve
    0

    Macro Parameter Help

    I am trying to add a simple parameter using a turnary within a Razor for a lightbox slideshow, but it is always acting as if the checkbox is checked to display titles (var showTitles). Could someone please look at my code to see what I am missing? Thanks!

    @{  
    var hide = (Parameter.hide == "0") ? @Html.Raw("display:block") : @Html.Raw("display:none");
    var trans = string.IsNullOrEmpty(Parameter.transition) ? @Html.Raw("transition:'elastic'") : @Html.Raw("transition:'@Parameter.transition'");
    var slideshow = (Parameter.slideShow == "1") ?  @Html.Raw("slideshow:true") : @Html.Raw("slideshow:false");
    var showTitles = (Parameter.showTitles == "0") ?  @Html.Raw("title:false") : @Html.Raw("title: function() { return '' + $(this).attr('title') + ''; }");
    }
       <script>    
    
    
    $(document).ready(function() {
           var $gallery = $('a.slideGroup').colorbox({rel:'slideGroup',@trans, @slideshow, opacity:'0.5', @showTitles});
    
    
        $("a#openGallery").click(function(e){
            e.preventDefault();
            $gallery.eq(0).click();
        });
    
    
    $('a.slideGroup').colorbox({onComplete:function(){
    
    var cboxTitleHeight = $('#cboxTitle').height();
    var cboxContentHeight = $('#cboxContent').height();
    var cboxWrapperHeight = $('#cboxWrapper').height();
    var colorboxHeight = $('#colorbox').height();
    var cboxPhotoHeight = $('.cboxPhoto').height();
    
    $('#cboxMiddleLeft, #cboxMiddleRight, #cboxContent').css('height', (cboxContentHeight + cboxTitleHeight) + 'test');
    $('#cboxWrapper').css('height', (cboxWrapperHeight + cboxTitleHeight) + 'test');
    $('#colorbox').css('height', (colorboxHeight + cboxTitleHeight) + 'test' );
    $('#cboxLoadedContent').css('height', (cboxTitleHeight + cboxPhotoHeight) + 'test');
    
    
    }});
        });
    

Please Sign in or register to post replies

Write your reply to:

Draft