joomla popup that should close only by click button - javascript

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!

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.

how do i link an a tag to an onload modal window?

I figured out how to make a modal window pop up as the page loads, but I was wondering how I can make it appear also after clicking on a link, so that if a first time user comes to the website, closes the onload modal window, and then wants to sign up, he can do so.
I got the code from: http://www.aspdotnet-suresh.com/2013/03/open-show-jquery-popup-window-on-page.html
and the website that i'm using it on is http://thewildernesswalk.businesscatalyst.com/
If you have a better solution than the tutorial i found (which would be great), I am all ears, but it seems like some of the other answers i found out there mess with the code that makes the nav stick to the top and the "back to top" button appear.
Thank you in advance
Assuming the code at the link you gave, you may insert the following in your HTML <body> in order to show the modal upon clicking hyperlink:
Click me!
<script>
var elem = document.getElementById('hyper');
elem.onclick = showModal;
function showModal() {
$('.popup').show();
return false;
}
</script>

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 +

Refresh a specific page when pop-up is closed (jQuery)

I have a pop-up called PopUp1 (page0.aspx). When the user clicks a row in PopUp1's GridView, it opens a new pop-up that loads my page1.aspx.
If the user clicks a link in the new pop-up (page1.aspx), then the content will be replaced with that of page2.aspx.
What I want: If the user closes the window of my second pop-up that opens page1.aspx or page2.aspx, then refresh PopUp1 (page0.aspx).
How can I do that via jQuery ?
in page1.aspx and page2.aspx add some javascript to refresh their parent (you don't need any jquery for this)
In your markup:
<body onunload="refreshParent();">
In your javascript:
var refreshParent = function () {
if (opener && !opener.closed) {
opener.location.reload();
}
};
Edit: alternatively, if you want to keep your logic seperated from your markup:
$(window).unload(refreshParent);
In your new popup (page1.aspx or page2.aspx), put the following jQuery and it should refresh the opening window when that popup is closed or refreshed:
$(window).unload(function(){
window.opener.location.reload();
});
If you'd like you could also change the location of the opening page by using the .assign method if you want to do some kind of workflow logic in your page,
for example window.opener.location.assign('http://newurl');
You could use plain javascript
window.opener.reload();

lightbox not working correctly

I have a problem in lightbox. This is the link when i clicked login form appears.
<a href="index.php?g=login.html" title="Login Form"
rel="gb_page_center[425, 220,login.html]">Login</a>
When I click the link before page loads, page opens in new window. light box isn't working correctly. I need to block this link utill lightbox loads.
How can I do this in javascript?
click the top corner link login
Link: http://www.clubforeducation.com/
Did you try adding some attribute like onclick='return false;' ?
You might want to include your lightbox javascript code at the bottom of the page.
Or hide all your images initially while page is loading; once page is loaded, you can show all links again with something like below:
window.onload = function()
{
// note: using jquery here
$("a.lightboxlinks").css('display':'inline');
};

Categories

Resources