Jump to content

JQuery on clicks


matfish

Recommended Posts

Hi there,

 

I'm using JQuery to click "View Basket" which an DIV overlay then appears with your items in the div.

I'm also using a body onclick so you can click anywhere on the page which then hides the basket.

 

But I've added links in the Div Overlay now so you can remove an item from the basket, but the body onclick kicks in and just hides the Div again.

 

Any ideas how I can click anywhere on the page to hide the Div overlay but also have the functionality to click a link within the Div and not hide the Div?

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/208160-jquery-on-clicks/
Share on other sites

Hi there,

 

the code I have so far is:

 

<script>

function showDiv(){
if($('#YourDiv').is(":visible")){
	$('#YourDiv').hide();
}else{	
	$('#YourDiv').show(function(){
		$('.fullWindow').click(function(){
			$('#YourDiv').hide();				   
		});
	});
}//
}//showDiv()

</script>

 

I'm not sure how to use bind yet so when the .fullWindow (which is a div around the whole page) is clicked it hides the Div overlay and doesn't let me action a click within the Div.

 

Also, there seems to be a bit of a transition/animation where it slides down rather than just showing immediately. Any idea how to remove the animation?

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/208160-jquery-on-clicks/#findComment-1088500
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.