Disable any popup , When clicked on particular link - javascript

I am using popup advertising in my website.So it basically opens ads when clicked inside body.
But I want to disable any popups when link with class donot is clicked.
Right now when below link is clicked , popup opens and the donot link wont work.
<a class="donot" href="http://google.com">link</a>
I want To disable all popup activities and open the link when class donot is clicked
I tried below
$(".donot").click(function(e) {
e.preventDefault();
});​
I am unable to find anything in popupcode .Here is my adnetwork popup code http://jsfiddle.net/hsz2hyvw/
Here is demo of popup opening http://jsfiddle.net/hsz2hyvw/3/

Try this
$("body").click(function(e) {
if ($(e.target).hasClass('donot')) {
return false;
}
alert('d');
});​
Working Demo Here

Related

how to show a message in popup at a page when a user come to that page but the condition is we have to use Featherlight popup no Colorbox or etc

Please visit at this url, there is a 'default' button when you click on this url a popup will appear.
I want the same but when i don't want to fire any user event this popup will appear onload
http://noelboss.github.io/featherlight/
If you want the popup on page load then just add some JS code:
$(document).ready(function() {
$("#popup").click();
});
give the id or class name of your tag where is popup exit instead of popup object.

joomla popup that should close only by click button

I am using popup anywhere plugin in joomla. I have to display article page detail on that popup at time of user log in. But here popup close on click out side of popup screen also, i dont want this. Popup should only close at time of clicking "Agree" button that article have.
Please let me know if you have any other plugins or ideas.
This should prevent the window from being closed by clicking away from the element:
$('#your-close-button').click(function(e){
e.stopPropagation();
});
Joomla has a modal window as part of its core code, which is based on the mootools Squeezebox. You can call up an iframe in a modal window which cannot close like this:
<?php JHTML::_('behavior.mootools'); ?>
<a href="http://www.example.com/page2.html" class="modal"
rel="{closable: false, handler:'iframe'}">
Click here to launch a popup</a>
If you then want page2.html to have a close button, you should add this script to the parent window,
<script>
function closepopup() {
SqueezeBox.close();
}
</script>
and create the button like this:
CLOSE!

Fancybox content disappears

When I try to click a field the content goes away. I only want the x button to close the popup not the overlay or content. I also notice that when I double click on the #contactus and #contactus2 the popup goes away but not the overlay.
Please click on "View the lines" to see the popup.
Here is the fire code:
$(document).ready(function() {
$("#contactus").fancybox({
'hideOnOverlayClick':false,
'hideOnContentClick':false
});
$("#contactus2").fancybox({
'hideOnOverlayClick':false,
'hideOnContentClick': false
});
$("a#inline").fancybox({
'hideOnContentClick': false
});
});
to clarify what I said below:
you have a call to fancybox on the link with id=inline (you have two links with the same id, you should probably be using a class instead). the links with the id=inline are opening up their targets, which are div#contactus and div#contactus2. you are also calling fancybox on div#contactus and div#contactus2, which is causing those divs to open a fancybox.
see this fiddle.
it looks like this line:
$("#contactus2").fancybox({
'hideOnOverlayClick':false,
'hideOnContentClick': false
});
is causing a click on the div inside the fancybox to open ANOTHER fancybox inside. try removing that and clicking Houston to see if it works.

Open a new window in a small size inside a Modal popup

I am working on a social share button. Look up here
If click on "SHARE THE GOODNESS" a modal pop up is generated
I am trying to do that once the modal pop up is generated if i click on one of the Social media button to share the page i get a new smaller window inside the same page and not in a new tab.
In other words, i want to achieve the same i am achieving in the page if i click in the other button blu example "CLICK HERE".
Here the script i have used for the button "CLICK HERE"
<script>
$('#openfacebookwindow').click(function(ev){
window.open('http://www.facebook.com/sharer.php?u=http://yourwebsite.com','Title','width=200,height=400');
ev.preventDefault();
return false;
});
</script>
If i apply the same technique in the modal popup, it does not work,
My question is, is it technically possible to do the same in the Modal pop up?
If yes, how i have to work it out
Thanks
I see that #Manna got the solution:
function popitup(url) {
newwindow=window.open(url,'name','height=400,width=500');
if (window.focus) {newwindow.focus()}
return false;
}
Google +

How do I add a custom hide/close link to a modal box displayed using lightbox2?

I am using http://lokeshdhakar.com/projects/lightbox2/. It has a "X" button in its corner that closes the modal box. I want to add another close link in the window (a text link).
Close
How do I implement closeLightboxWindow()? :)
Link:
<a class="closeLightbox2" href="javascript:none;">Close</a>
Find in lightbox.js string:
$lightbox.find('.lb-loader, .lb-close').on('click', function(e) {
Add like that your class
$lightbox.find('.lb-loader, .lb-close, .closeLightbox2').on('click', function(e) {
That's all, don't forget clear browser cache

Categories

Resources