javascript - jQuery: clicking on a table located in an iframe -
i have ordinary table in html in iframe , access parent page (yes on domain , server) i've tried every kind of:
$("#iframe").contents().find("#mytable td");
i don't have impression detects table cell or table @ all. indeed event on it.
$("#mytable td") .mousedown(function () { ismousedown = true; $(this).toggleclass("highlighted"); ishighlighted = $(this).hasclass("highlighted"); return false; }) .mouseover(function () { if (ismousedown) { $(this).toggleclass("highlighted", ishighlighted); } })
this event works on single page css style linked how should when using iframe? what's correct sentence detect table in iframe?
thanks in advance.
make sure selector, #iframe, on iframe element id.
then setup in javascript...
var mframe = $('#iframe').contents(); var mtable = mframe.find('#mytable td');
then go town mtable, within $(window).load(function(){...}
Comments
Post a Comment