Hello,
I need some script.
- To hide a div by clicking anywhere on the page
- To hide a div by clicking on button, images or particular script
- To hide a div by clicking anywhere on the page ( when div contain any other script)
Please help me with code
Hello,
I need some script.
Please help me with code
Have you a website and links to pages that show what you have tried and what is not working?
Here is some PHP script to get you started:
<!doctype html>
<href>
<head>
<title>Hide div_one </title>
</head>
<body>
<div>
<a href="?hide=div_one">
Hide div_one
</a>
<?php if( isset( $_GET['hide'] ) && 'div_one' === $_GET['hide']) { ?>
<h4> this is shown instead of div_one </h4>
<?php }else{ ?>
<div id="div_one">
this is div_one
</div>
<?php } ?>
</div>
</body>
</html>
BEWARE: Not tested
I am currently using
<script>
$(document).ready(function () {
$("#div").click(function () {
document.getElementById('div').style.display = 'none';
});
});
</script>
This working fine why div contain images, but it not working when div contain script (such as normal script, any advertisement script, anyscript)
Please tell how to do.
That script is not PHP and mainly JavaScript setting your CSS script.
Please request this topic to be moved to the JavaSctipt category.
Also please show the complete source page, for each problem you are unable to solve.
I moved it.
Hello,
I need some script.
Please help me with code
I am currently using
<script>
$(document).ready(function () {
$("#div").click(function () {
document.getElementById('div').style.display = 'none';
});
});
</script>
This working fine why div contain images, but it not working when div
contain script (such as normal script, any advertisement script,
anyscript)
Please tell how to do.
Since you’re using jQuery, you might as well just do:
$(document).ready(function () {
$("#div").click(function () {
$(this).hide()
});
});
Not working with adsense code bro
Working on blogger! thanhk
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.