Support » Themes and Templates » colorbox in custom theme

  • Hello,
    I am doing a custom theme, I am uploading an index file to the worpress new theme I am doing.

    my problem is this:
    I have a link in the custom index.php that I am creating, I want when somebody clicks on that to open a colorbox and watch the video from there from youtube.

    I think I uploaded everything, and the javascript for the colorbox. the jquery latest version is already there in use.
    when I go to preview the template, the link is there, but, when I click on the link, the video shows up in the entire frame on the right. is this ok?
    how do I know I am doing the right thing? I do not want to activate this theme yet, I am just previewing it for now.

    this is my code:

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>colorbox.css"/>
        <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.colorbox.js"></script>
    				//Examples of how to assign the Colorbox event to elements
    				$(".group2").colorbox({rel:'group2', transition:"fade"});
    				$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
    				$(".group4").colorbox({rel:'group4', slideshow:true});
    				$(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
    				$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
    				$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
    				$(".inline").colorbox({inline:true, width:"50%"});
    					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
    					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
    					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
    					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
    					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
    				$('.non-retina').colorbox({rel:'group5', transition:'none'})
    				$('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
    				//Example of preserving a JavaScript event for inline calls.
    					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
    					return false;
    and for the link:
    and for the link:
    <a class="youtube cboxElement" href="">WATCH OUR INTRODUCTORY VIDEO</a>

    Thank you very very much

    thank you for helping me

  • The topic ‘colorbox in custom theme’ is closed to new replies.