jquery keep selecting same iframe -
i have iframes created jquery each iframe has select button, when click button iframe keep getting first iframe.
$("<iframe />" , { src: strtest, id: "myframe", width: '100%' }).appendto('.content'); $("<button/>", { id: "button" }) .text("select patient") .click(function () { $("#myframe").attr("height", "125%").addclass("selectediframe"); var isvisible = $("selectediframe").is(":visible"); }).appendto('.content'); $(".selectediframe").parent().show();
can me please. thanks
you need come own way of adding unique characteristic next 'myframe' or can give me info on how come iframes , perhaps can provide more assistance
// generate 10 iframes var numberofiframes = 10; (var = 0; < numberofiframes; i++) { // iframe $("<iframe />", { src: strtest, id: "myframe" + i, width: '100%' }).appendto('.content'); // button $("<button/>", { id: "button" }) .text("select patient") .click(function () { $("#myframe" + i).attr("height", "125%").addclass("selectediframe"); var isvisible = $("selectediframe").is(":visible"); }).appendto('.content'); } // not sure trying achieve // execute once when page loads $(".selectediframe").parent().show();
Comments
Post a Comment