0

The jQuery code is like:

var $seatdiv = $('<div id = "seat'+i+'" class="seat-class"></div>')
.css({left: leftValue + 'px', bottom: bottomValue + 'px'});

I tried to add this "bootstrap" code, but it is not working:

$seatdiv.popover({content:row_label+" "row_name+"  " +column_label+ " "+column_name});

Who can tell me how I should write these code together? Cheers.

1 Answer 1

1

I am not too familiar with the bootstrap stuff, but by just looking at the code it seems like the jQuery selector is a little off. You should reference only by ID, so it would look more like:

var itemID = '#seat' + i;    
$(itemID).css(...);
$(itemID).popover(...);

jQuery selectors are just like CSS selectors: http://api.jquery.com/category/selectors/ -- ids are accessed with a '#' before their name, and items of a certain class are accessed with a '.' before the name of the class.

Also, reading through the docs (http://twitter.github.com/bootstrap/javascript.html#popovers), does your copy of bootstrap.js include the tooltip code? It is required.

All of your other code looks like it should work to me.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.