用于PHP的I m非常新,因此,定制现成的手稿还不是矿床。
I have an animated popup modal script, which currently triggers when a certain is clicked. I d also like to trigger this same script automatically when a particular div exists on the page.
如你从法典中可以看到的那样,pmask是一页黑体的中转层。
这里我需要调整的文字:
$(document).ready(function() {
//select all the a tag with name equal to modal
$( a[name=modal] ).click(function(e) {
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var id = $(this).attr( href );
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set height and width to mask to fill up the whole screen
$( #mask ).css({ width :maskWidth, height :maskHeight});
//transition effect
$( #mask ).fadeIn(1000);
$( #mask ).fadeTo("slow",0.8);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css( top , winH/2-$(id).height()/2);
$(id).css( left , winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(2000);
});
});
目前,当这一链接被点击时,它自动开放:
<a href="#" name="modal">
我试图让它自动运行,因为这个DIV在网页上存在:
<div name="showintrovideo"></div>
谢意如此之多,你们总是如此伟大的帮助!
<>----><>>>
http://www.ohchr.org。
这里的Im完整法典涉及:
传真
<div id="boxes">
<div id="qrcodemarketing" class="window">
<!-- close button is defined as close class -->
<div style="float:right;">
<a href="#" class="close"><img src="images/close_window.png" width="22"height="22" alt="Close Window" /></a>
</div>
<iframe width="640" height="480" src="http://www.youtube.com/embed/MYVIDEO" frameborder="0" allowfullscreen></iframe><br /><b>Pause the video before closing this window</b>
</div>
</div>
<!-- Do not remove div#mask, because you ll need it to fill the whole screen -->
<div id="mask"></div>
CSS
#mask {
position:absolute;
width:100%;
height:100%;
left:0;
top:0;
z-index:9000;
background-color:#000;
display:none;
}
#boxes .window {
position:absolute;
background:none;
display:none;
z-index:9999;
padding:20px;
color:#fff;
}
.js file
$(document).ready(function() {
//select all the a tag with name equal to modal
$( a[name=modal] ).click(function(e) {
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var id = $(this).attr( href );
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set height and width to mask to fill up the whole screen
$( #mask ).css({ width :maskWidth, height :maskHeight});
//transition effect
$( #mask ).fadeIn(1000);
$( #mask ).fadeTo("slow",0.8);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css( top , winH/2-$(id).height()/2);
$(id).css( left , winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(2000);
});
//if close button is clicked
$( .window .close ).click(function (e) {
//Cancel the link behavior
e.preventDefault();
$( #mask, .window ).hide();
});
//if mask is clicked
$( #mask ).click(function () {
$(this).hide();
$( .window ).hide();
});
});
可能只是 t弄案卷,以便能够自动和点击地打开?
感谢!