jquery页面加载行为
我的项目有3页 jq-scripts.jsjquery页面加载行为,jquery,jquery-ui,Jquery,Jquery Ui,我的项目有3页 jq-scripts.js // # DOM Ready $( function() { $('.ttip').tooltip(); $( '#sample_page' ).load("sample.php"); }); sample.php <p class="ttip" title="some text">Hallo</p> 您好 index.php <head> <link rel="stylesheet"
// # DOM Ready
$( function() {
$('.ttip').tooltip();
$( '#sample_page' ).load("sample.php");
});
sample.php
<p class="ttip" title="some text">Hallo</p>
您好
index.php
<head>
<link rel="stylesheet" href="css/smoothness/jquery-ui-1.10.0.custom.css" type="text/css" />
<script type='text/javascript' src='js/jquery-1.9.1.js'></script>
<script type="text/javascript" src="js/jquery-ui-1.10.0.custom.min.js"></script>
<script type='text/javascript' src='js/jq-scripts.js'></script>
</head>
<body>
<div id="sample_page"></div> <!-- TOOLTIP DON'T WORK -->
<p class="ttip" title="some text">Hallo</p> <!-- TOOLTIP WORK -->
您好
有人知道为什么加载页面(sample.php)的工具提示不起作用吗?谢谢一旦元素实际可用,您可能应该初始化工具提示插件:
$( function() {
$( '#sample_page' ).load("sample.php", function() {
$('.ttip').tooltip();
});
});
一旦元素实际可用,您可能应该初始化工具提示插件:
$( function() {
$( '#sample_page' ).load("sample.php", function() {
$('.ttip').tooltip();
});
});
这应该行得通
$( function() {
$( '#sample_page' ).load("sample.php");
$('.ttip').tooltip();
});
因为我无法在.load()中加载sample.php页面,所以请使用innerhtml,这应该可以工作
$( function() {
$( '#sample_page' ).load("sample.php");
$('.ttip').tooltip();
});
由于我无法在.load()中加载sample.php页面,所以请创建innerhtml,