English 中文(简体)
PHP 定制模块,以显示存在DIV
原标题:PHP Customizing Module to show if DIV exists

用于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弄案卷,以便能够自动和点击地打开?

感谢!

问题回答

你也许最好利用会议或厨师来决定是否展示内部录像。 我也用你可以呼吁的“ j子”的方法总结你们的流行。 类似:

$( a ).myPopupMethod();

这样,你也可以从方案上说:

$.myPopupMethod();

在您的超文本网页上,你可以使用购买力平价来确定是否显示你的流行:

<?php
    session_start();

    $video_watched = $_SESSION[ video_watched ];
?>
<!DOCTYPE html>
<html>
  <body>
    <script src="jquery.js"></script>
<?php if ($video_watched != true): ?>
    <script>
        $(document).ready(function() {
            $.myPopupMethod();
        });
    </script>
<?php endif; ?>
  </body>
</html>




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签