<div id=“modaldialog1”>
place content here
</div>
</body>
this is the code i have i html page. how do i make my modal dialog appear when i open my html page.
Please…help me out
I am new to this area of technology, i have been doing lot of google…but everything has href tag.
i just don’t get this javascript part. I got to submit my page.
Thanks. but is there any way of adding/modifying to javascript above to call dialog when opening the html page
And please don’t give me one line answers. i need some sort of explanation. i don’t know anything about javascript till i came to use this dialog.
Thanks. using window attribute gives dialog on load. but in what way, i would modify my script part, to use the example to call the dialog on page load.
Now, i saw lot of examples like this. but i am looking at the way on how to modify my script part to adapt the changes in the example. That is where i am stuck.
my dialog opens on clicking link. it should not happen. sholud open when i open my page url.
And again…i don’t know anythng about javascript till my encounter with this dialog.
Thanks.
Ok will try to post it in js fiddle but not sure due to company rules .
But that’s the code in my HTML page.
Script files- refers to jQuery-1.8.2.min.js
And jquery.min.js and I got a local scriptfile
Called myutilities.js.
The dialog mydialog is what calls the dialog. That what initializes the dialog box and calls modaldialog1.
Modaldialog1 is the id of the dialog box.
Any help with this information,any help greatly appreciated .
The point is I am a fresher and that’s the struggle.
I understand the examples but how to implement in my script part, is what I am wondering .
I appreciate that you might be restricted to what you can post by your company, but what you have provided already is not really enough to go on.
We don’t know what myutilities.js is doing or how the rest of your page is structured.
Ok…thanks for all the reference so far. i had submitted it the way it is and have said i will try that out later.
I have been doing lot of digging in to this modal , and came across leanmodal.js.
I used the explanation in leanmodal, and typed this , but the trigger element did not work.
Can you modify this and give me full functional code to open dialog box on page open with leanmodal.js. and also please point out what i did wrong.
And any suggestions. I am struggling. plz, i need a helping hand…
Thanks. Point noted. Now, can I introduce window attribute inside the same function to display the modal on page open, or I have to write another function(). -with ref to dynamic drive.com post.
Yes it does. Hoorayyy!!! Thank you so much.
And also thanks to others, through this post I have learnt lot.
Cheers.
Can I get an explanation , how adding that click() opens dialog on page open.
Any articles or reference or book, I want to understand the solution u had given. Sorry, if this question looks not so right.
which you initialize like this when the page loads:
$(function(){
$("#overlaytrigger").leanModal({ top : 200, closeButton: ".modal_close" });
});
When you click on this link, the modal box fires.
All I did was simulate a click on this link when the page loads, by adding this line:
$("#overlaytrigger").click();
which has the desired effect.
For the case you know absolutely nothing about jQuery, all that the above statement says is select the item with an id of “overlaytrigger” and simulate a click event.