JQuery :: Colorbox: Can't Show Div With Selector

Oct 25, 2011

I'm trying to show a div using colorbox, and for some reason, the following is not working: jQuery("div#the_div_that_i_want_to_show").colorbox();

Calling the function directly, however, does work:

$.fn.colorbox({'href':'div#the_div_that_i_want_to_show', 'open':true, 'inline':true});

And passing the div as an argument also works (with arguments 'inline' and 'open' set):$("div#the_div_that_i_want_to_show").colorbox({'href':'div#the_div_that_i_want_to_show', 'inline':true, 'open':true});

This, of course, is sort of redundant, as we're already selected the element with jQuery; there should be no need to also pass it as an argument.However, when I strip out the 'href' argument this does _not_ work--All I get is an empty colorbox/modal: $("div#the_div_that_i_want_to_show").colorbox({'inline':true, 'open':true});

For completeness, here is the div:

<div id="the_div_that_i_want_to_show" style="font-size: 18pt">Hello world</div>

why colorbox is not receiving the wrapped set from the jQuery selector?This call is very similar to that discussed on the following page:: [URL]

View 3 Replies


ADVERTISEMENT

JQuery :: URL Tracking With Colorbox?

Nov 4, 2010

Is there an approach that I can take to have the URL change and still open a Colorbox?I need to get some tracking code to display in the URL, but I guess the <a> tag isn't really followed when I open the colorbox, so the URL change is cancelled when I click to open the Colorbox.

View 1 Replies View Related

JQuery :: Using Cookies With Colorbox

Apr 29, 2011

I am somewhat new to JQuery and I am trying to use cookies with a colorbox.

Here is the code I'm using

[code]

The end goal is to display the link with the pop_search_searay class (that opens the colorbox) when a cookie is not set. If there is a cookie, then the other link (with id=cookieyes) should display instead (so the colorbox does not open in this case).

I am having trouble with the if cookie is true statement.. After colorbox closes, even if the cookie is set, as soon as I view another page for some reason the cookie seems to reset as I am still seeing the link with the colorbox class displayed.

Is my if true statement incorrect? Do I need to move it somewhere else in the code?

View 2 Replies View Related

JQuery :: Re-Initialize Colorbox From Within IFrame

Apr 25, 2011

As you no doubt know, a link that is generated on the fly (ie by a JS function) and is supposed to invoke a ColorBox (due to a predefined selector) doesn't work as the link didn't exist when the ColorBox was initialised e.g., you have this in the head:
$(document).ready(function(){
$(".frmMe").colorbox({iframe:true, innerWidth:1200, innerHeight:640});
}

Then a link generated by JS at a later time (for example triggered by a users click) like:
<a href="blah.php" class="frmMe">Easter Eggs</a>

Whenever I dynamically create a link like the one above, I re-run the line:
"$(".frmMe").colorbox({iframe:true, innerWidth:1200, innerHeight:640});" afterwards to ensure the colorBox functionality works.

Now however, I have an instance where a link on a parent page like the above is created from within an iFrame (on the fly using JS). Unfortunately however, I haven't been able to find a way to re-intialize the ColorBox on the parent page from within the iframe to ensure that the new link has ColorBox functionality enabled.

I have tried:
$('.frmMe', parent.document.body).colorbox({iframe:true, innerWidth:1200, innerHeight:640});
but it seems to have no affect and generates no errors (yet this follows the format I use to create the link. On the page which is:
$('#updateBx', parent.document.body).html('<a href="" class="frmMe">Glorious</a>');

View 1 Replies View Related

JQuery :: Colorbox - Does It Work For Text

Aug 18, 2010

[URL]you will notice if you click the image, the Colorbox comes up with a new image, BUT if you click the word Details below the image, the colorbox effect does not take place, even though it using the same link as the image. is there a way to make that text link be clicked and have an image pop up in the colorbox style?

View 3 Replies View Related

JQuery :: ColorBox Does Not Open After Replacing <body> Content

Nov 2, 2010

I'm using ColorBox to open a simple popup and it works fine. In the same page I have a link which sends an ajax request which return the entire <body> content that I then use to replace the body of the current page. After I do this replacement, the colorbox does not open anymore. I got no JS errors.

Here is a code which reproduces this behaviour

<html>
<head>
<script src="js/jquery-1.4.3.js"></script>
<script src="js/jquery.colorbox.js"></script>

[Code]....

In the submitAjax() function I simply replace the body of the current page with the same content.

View 9 Replies View Related

JQuery :: Setting Image To Link To Itself And Open In Colorbox

Jul 20, 2011

I have an image that has been resized via CSS to show as 100x100px on an HTML page. When clicked, I want to open the image in a colorbox - so the user can see the non resized/squashed version as it will normally appear. I've worked out how to set the path of the href to itself (so this doesn't have to be changed every time) (see below), although not sure how to get the colorbox part working - I tried changing 'each' to 'colorbox' - as per how you would normally assign the colorbox, and it opens, it just doesn't load the image in it.

<div class="logoImage"><img src="../tym_img_shared/background-2.jpg" alt="Your company logo" /></div>
$(document).ready(function(){
$('div.logoImage img').each(function(){
var $this = $(this);
$this.wrap('<a href="' + $this.attr('src') + '"></a>');
});
});

Thinking about it, perhaps it would be easier to also set the 're' attribute of the link whist setting the source?
$(document).ready(function(){
$('div.logoImage img').each(function(){
var $this = $(this);
$this.wrap('<a rel="gallery" href="' + $this.attr('src') + '"></a>');
});
});
Doesn't work for some reason - but it does if I hardcode the URL and rel?

View 6 Replies View Related

JQuery :: AnythingSlider Inside SimpleModal Or ColorBox Shows Crunched Display

Dec 15, 2010

I have been trying to display "anythingslider" plugin inside a jquery modal popup. I have tried with both colorbox and simplemodal and both give exact same effect. The effects I am seeing is when the modal window is launched the anythingslider shows the start button and the 2 green 1-2 tabs stacked vertically on top of each other. I don't see anything else (no slides etc).I am testing with the code found here:URL....I am using the setup and example code as it is listed on the page.[code]

View 1 Replies View Related

JQuery :: Difference Between Class Selector And ID Selector?

Sep 8, 2011

Are there any difference between class selector and ID selector

View 2 Replies View Related

Use Colorbox To Individually Load The Larger Versions Of Images?

May 9, 2011

Is it possible to use Colorbox to individually load the larger versions of images?I want to assign their default of rel="example1" to various images on the same page, but have them display individually rather than in a linked gallery.

View 2 Replies View Related

Find Example Of Country Selector Which Also Provides A State Selector If USA Is Chosen

Jun 5, 2009

I'm trying to find an example of a country selector (which also provides a state selector if USA is chosen) then you cvan select the city, any samples out there?

View 2 Replies View Related

Display "Message Sent" Alert In Same Colorbox Modal Window As Contact Form

Dec 30, 2010

When a user clicks the "Send Carol a Message" button and submits the form I would like the "Message Sent Successfully" alert to display within the modal window. Ideally, I would like for the modal to close after "X" seconds but this is not an absolute necessity

[Code]...

View 1 Replies View Related

JQuery :: Using More Than One Selector?

Jan 26, 2011

I'm trying to create a drop down menu which has several levels. When a level is clicked on, other expanded categories in that level should minimize simultaneously. The trouble I'm having is using a combination of selectors to say 'all divs which match this pattern but not this one'. I've had a look through the selectors API pages

View 1 Replies View Related

JQuery :: Attribute Contains Selector [name*=value]?

Jul 30, 2010

i use it in a CMS. In my content page, when I insert a floating element, I use it to set the margin around element according to left or right float in this way:

$('#content img[style*="float:left"]).css({
'clear' : 'left',
'margin': '0px 20px 10px 0px'
});

in chrome, mozilla and not-IE browser the selector with (: and/or ;) works but in IE doesn't work. Is there a solution?

View 3 Replies View Related

JQuery :: Can't Get The Right Selector For Forms?

Aug 9, 2010

I have a problem that I couldn't solve myself. I have 2 forms. name="form1" and name="form2" In each form, there's the same class names for rows. <tr class="draggable">

What I need to do, is to take the last draggable row in a certain form. $( tr_object + " tr.draggable:last" ) <- returns the last tr with class draggable in whole document. How do I limit It's view/search scope to one of the forms only?

View 2 Replies View Related

JQuery :: Can't Use Selector Within Object?

Oct 26, 2010

var string = $('#newItemInput2').val(); // gives me "twats"

But when I try and embed it within an object it doesn't work:

Can a jquery selector not be used as the member of an object?

View 1 Replies View Related

JQuery :: Concerning Table Row Selector?

Mar 20, 2011

this code works for me , but there is something wrong , every time the function loads (every 2.5 seconds )the html is loaded in row [0] cell[0] , and they are stacked above each other . what may be wrong there ?

code :
var searchtable=document.getElementById("searchtable")
var resultscount=0

[code]....

View 2 Replies View Related

JQuery :: Contains Selector For One Element

Oct 20, 2011

I am using the contains selector for one element because I do not know the full ID. Since I only need the first element it finds should I be adding something to improve performance?

View 8 Replies View Related

JQuery :: Creative Use Of The Selector?

Jan 25, 2010

On our current project we had an very unexpierenced coworker which wroted an "a" tag as an jquery selector. to better understand what he did see the following working sample:

<html>
<head>
<script type="text/javascript" src="
http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>

[Code]...

This works in Firefox but not in IE (of course not Yeah we know its wrong, but we dont find a reason for its working in firefox ! can someone explain why this can even work ?

View 1 Replies View Related

JQuery :: Get Element From Selector?

Dec 5, 2011

That's my code:

var main = $("#content_value td:contains('Saque')").next();
alert($("img[title='Ferro']", main).text());

I'm trying to get the img element from the main selector, but it's not working..

[Code]...

View 11 Replies View Related

JQuery :: Getting A Variable Out Of A Selector?

Jun 3, 2011

The following code works:

$('#prov_1 .toggleEdit').click(function () {
$('#prov_1 .editable').toggle();
});
When I click on the "toggleEdit" button under #prov_1, the .editable elements in #prov_1 appear/disappear.
Now I want to do this for all prov_N.
$('#prov_' + pid + ' .toggleEdit').click(function () {
$('#prov_' + pid + ' .editable').toggle();
});

does not work. How do I extract or define N, the pid number?

View 4 Replies View Related

JQuery :: Use $ In A Quoted Selector?

Jun 12, 2009

I have a UL list with hyperlinks in the LIs. When I click on the hyperlink, I want to go up the list, and get the html() within the first LI in the list. I have a ('a') click function that returns the hyperlink as $(this).

Now how do I get up to UL and down to LI? (It's actually more complicated because I really want to go up to a top level UL and down to a top level LI...but let's start here).

When I start with $(this) how can I integrate it into a selector? For example, I can supposedly do ("LI > UL > LI:first"), but can I do ("$(this) > LI > UL > LI :first") or do I do ($(this) "> LI > UL > LI:first") ?

View 4 Replies View Related

JQuery :: Id And Class Selector At Once?

Mar 27, 2011

I am trying to make a sliding panel if you click a button, the only problem is that there are more of this panels on the page. I can make the first one open, but I cant make the one opening wich has the id=id.

[Code]...

View 6 Replies View Related

JQuery :: $ In Id Causes Selector To Fail

Jun 16, 2010

I'm trying to add some functionality to a existing application. I have no control over the input element ids. There are inputs I need to use that have $ in the id <input id='field1$0'>. Trying to use the id selector $('#field1$0') fails (result is undefined).Is this a bug or "by design" in qQuery?Is there a workaround, other than looping thru all inputs to find the ones I need?

View 4 Replies View Related

JQuery :: Selector To Handle Each DIV Among Many - With The Same ID

Jul 2, 2010

I was developing a very simple application, just for training some Ajax. It works like that:

» I make a search using Ajax and it gives me a list with a lot of cities according to their state;

» After receiving the data, I can only manipulate the first DIV (that contains the city data).

The problem is that the city boxes (DIVs) has the same ID and, when the jQuery function is set (to send the address to an input that will make a search through Google Maps API), it only works for the first DIV. Then, if I search new cities, it works, but the same manner :(

Check out the screenshots:

[url]

[url]

[url]

[url]

So... I can only handle the first DIV among all the anothers, because they have the same ID. I have already tried the .each(), .unique(), creating an array...

View 6 Replies View Related

JQuery :: :not() Selector Not Working On IE (6 To 9)?

Apr 11, 2011

ere is my problem : I want to select all the h2 in my #corps container, except those with a .post-title class.The following selector doesn't work with IE (from 6 to 9). No problem with Chrome, Firefox, Opera.#corps h2:not(#corps h2.post-title)The HTML:

<div id="corps">
<div id="contenu">
<h2>Actualités</h2>

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved