Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript bpopup jQuery不工作_Javascript_Jquery_Xhtml_Bpopup - Fatal编程技术网

Javascript bpopup jQuery不工作

Javascript bpopup jQuery不工作,javascript,jquery,xhtml,bpopup,Javascript,Jquery,Xhtml,Bpopup,我试图在我的xhtml页面中使用一个bpopup示例,我已经尝试了我所能想到的一切,但它不起作用 bpopup(jQuery插件) 这是我目前为止的尝试 HTML: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xml

我试图在我的xhtml页面中使用一个bpopup示例,我已经尝试了我所能想到的一切,但它不起作用

bpopup(jQuery插件)

这是我目前为止的尝试

HTML:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html">

<h:head>
<title>Calendar</title>


  <link rel="stylesheet" href="http://dinbror.dk/bpopup/assets/style.min.css" media="screen" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
   <script src="http://dinbror.dk/bpopup/assets/jquery.bpopup-0.9.4.min.js"></script>
   <script src="http://dinbror.dk/bpopup/assets/jquery.easing.1.3.js"></script>
</h:head>
<h:body>
 <!-- Button that triggers the popup -->
        <button id="#my-button">POP IT UP</button>
        <!-- Element to pop up -->
        <div id="#element_to_pop_up">Content of popup</div>
</h:body>
</html>
// Semicolon (;) to ensure closing of earlier scripting
// Encapsulation
// $ is assigned to jQuery
;(function($) {

 // DOM Ready
$(function() {

    // Binding a click event
    // From jQuery v.1.7.0 use .on() instead of .bind()
    $('#my-button').bind('click', function(e) {

        // Prevents the default action to be triggered. 
        e.preventDefault();

        // Triggering bPopup when click event is fired
        $('#element_to_pop_up').bPopup({
    content:'iframe', //'ajax', 'iframe' or 'image'
    contentContainer:'.content',
    loadUrl:'http://dinbror.dk/search' //Uses jQuery.load()
});


    });

});

})(jQuery);
任何帮助都将不胜感激

找到了

我刚刚删除了按钮id和弹出的元素中的

 <!-- Button that triggers the popup -->
        <button id="my-button">POP IT UP</button
        <!-- Element to pop up -->
        <div id="element_to_pop_up"> hello </div>

检查控制台是否有ajax错误。没有错误,按钮正在工作,但没有操作@CerlinBosscan。您给我们提供了任何示例演示来玩吗?5.示例5a,内容:使用ajax加载外部html页面的简单jQuery弹出窗口。(Ajax弹出窗口)只需忽略
弹出它
Id
#
必须做些什么:?从jQuery v.1.7.0中,使用.on()代替.bind()或
 #element_to_pop_up, .bMulti {
background-color: #FFF;
border-radius: 10px 10px 10px 10px;
box-shadow: 0 0 25px 5px #999;
color: #111;
display: none;
min-width: 450px;
min-height: 250px;
padding: 25px;
}

#element_to_pop_up .logo {
color: #2B91AF;
font: bold 325% 'Petrona',sans;
}

.button.b-close, .button.bClose {
border-radius: 7px 7px 7px 7px;
box-shadow: none;
font: bold 131% sans-serif;
padding: 0 6px 2px;
position: absolute;
right: -7px;
top: -7px;
 }

.button {
background-color: #2B91AF;
border-radius: 10px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
color: #FFF;
cursor: pointer;
display: inline-block;
padding: 10px 20px;
text-align: center;
text-decoration: none;
}