Glen Robson
Glen Robson

Reputation: 938

using jQuery within Colorbox

I am having some problems when trying to use jQuery from within colorbox.

When I call any jQuery from the page that calls the colorbox it works fine.

My code currently calls a colorbox with another page inside it using the following code.

var page1 = '/page1/page.php';

jQuery(".page1click").colorbox({opacity:0.4, rel:'nofollow', href:page1, height:'700px', width: '702px', iframe:true});

This all works correctly and my code is showing within the colorbox popup. Also all of my javascript code is working within this page. However when I try and use any jQuery from within the colorbox it does not work.

What i am trying to do is hide a div when it is clicked.

If anyone could help that would be great

Upvotes: 0

Views: 264

Answers (2)

lintu
lintu

Reputation: 1102

Check whether u included jquery in both the pages. This can create conflicts.

Upvotes: 3

Mysteryos
Mysteryos

Reputation: 5791

With plugins that create overlays, like colorbox, they take your html markup and create another element in the DOM with it. Therefore the div you are trying to hide, might not have the same ID/class that you used to create it.

Please inspect the element using firebug in firefox to see what ID/class your div has been assigned by the plugin when you are viewing the box created by Colorbox.

Upvotes: 0

Related Questions