Hi Adrian.
No it's not working. Let me explain what I'm trying to do, maybe you'll spot
a flaw.

I got these anchors, all having class  'ex2trigger'. So what I do is attach
a div modal window, 'ex2', to them on document load like this:
$('#ex2').jqm({ajax: '@href', trigger: 'a.ex2trigger'}). And it works like a
charm.

Then I write the code that unbinds the modal window from a link, when
clicked, because you see, these links have 2 states: selected and not
selected. When they are not selected, and user clicks them, the modal window
shoud pop up. And it does wonderfully. So then the link becomes selected and
the modal window gets detached from that link by running this
$("#myLinksId").unbind(); 

Then, if a certain event occurs I WANNA ATTACH THE MODAL WINDOW BACK TO THE
LINK. That's not working anymore. I've tried running this code
$('#ex2').jqm({ajax: '@href', trigger: 'a.ex2trigger'}) again, but nothing.
I've tried this:
$('#ex2').jqmAddTrigger(document.getElementById(myLinksId)). Still nothing.
I simply can't seem to find a way to attach that modal div back to the link.

Any clue?
Thanks!




Adrian Lynch-2 wrote:
> 
> 
> As far as I know you can run whatever JS you want in the a tags
> onclick attribute. Is it not working?
> 
> Adrian
> 
> On Oct 25, 4:21 pm, vanwil  wrote:
>> Hi.
>>
>> I would like to call jqm on an element's onclick event.  It does not
>> work.
>> Why is that?  Is it MANDATORY to make these calls inside the $().ready
>> function? Is it impossible to do something like this
>> $('#myDiv').jqm({ajax:
>> '@href', trigger: 'a.ex2trigger'}); inside a button's onclick event?
>>
>> Thank you!
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/is-it-possible-to-call-jqModal-after-the-page-has-loaded--tf4691602s27240.html#a13440776
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to