Php jqueryhide-div';s、 p、a、李等
我有这个代码和jquery函数,可以在按下右键时隐藏HTML元素,但为什么不工作呢Php jqueryhide-div';s、 p、a、李等,php,javascript,jquery,file-get-contents,Php,Javascript,Jquery,File Get Contents,我有这个代码和jquery函数,可以在按下右键时隐藏HTML元素,但为什么不工作呢 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <script> $(document).on("mousedown", "div, p, img, span, a", function () { if
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script>
$(document).on("mousedown", "div, p, img, span, a", function () {
if (event.which === 3)
$(this).hide();
});
</script>
<?php
$url = 'http://www.kupime.com/';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>
$(document).on(“mousedown”,“div,p,img,span,a”,function(){
if(event.which==3)
$(this.hide();
});
您缺少param事件,而且您使用的是jQuery 1.3.2,它还没有功能。在
上,您至少需要1.7
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script>
$(document).on("mousedown", "div, p, img, span, a", function (event) {
if (event.which === 3)
$(this).hide();
});
</script>
<?php
$url = 'http://www.kupime.com/';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>
我认为您的语法已经关闭,api.jquery.com/mousedown.mousedown()事件。尝试按$('div,p,img,span,a')选择元素。mousedown(function(){}) 您还在“mousedown”函数中引用事件,其中未定义事件
$('div, p, img, span, a').mousedown(function()
{
$(this).hide();
})
以及重新展示
$('div, p, img, span, a').mouseup(function()
{
$(this).show();
});
为了你
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script>
$(document).ready(function()
{
$('div, p, img, span, a').bind("mousedown", function(e)
{
if (e.which === 3)
{
$(this).hide();
}
});
});
</script>
<?php
$url = 'http://www.kupime.com/';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>
$(文档).ready(函数()
{
$('div,p,img,span,a').bind(“mousedown”,function(e)
{
如果(e.which==3)
{
$(this.hide();
}
});
});
如何在我的函数上实现这一点,因为这项工作非常奇怪,我如何更改背景:悬停以了解元素是什么hide@thescientist-我投了你的票,我建议用我的答案来代替使用1.7+来解决他的问题。@user1094631-我不确定你的意思是什么,因为这项工作非常奇怪,我如何更改背景:悬停以知道隐藏了什么元素
右键单击弹出窗口(这是一个DIV)必须用这个隐藏弹出窗口,但似乎不起作用。你应该更新你的代码,向我们展示你的尝试。我去了你的链接,但弹出窗口不允许我尝试任何东西。是的,但这个弹出窗口是一个Div,右键单击它们必须隐藏!但是我用$url来改变pluspon域。好吧,我看到了这个,但是如何解决呢?我想基本标签可以解决这个问题,但看起来不太好
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script>
$(document).ready(function()
{
$('div, p, img, span, a').bind("mousedown", function(e)
{
if (e.which === 3)
{
$(this).hide();
}
});
});
</script>
<?php
$url = 'http://www.kupime.com/';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>