I have a page A which has exit popup. I want it to be show on Page B. I used iframe for displaying page A on B.
Edit:Page A is having a Exit Popup which i dont want in Page 2.
But Page A is having annoying popup. Assuming i can't edit Code of Page A. Can i just make some code in my page B . To remove Exit Popup?
Please provide me with sample code. I would prefer it to run on My Lamp Shared hosting.
I can use anything in place of Iframe if need be.
Thanks.
i don't know what you mean but if you want to use pop up you can use jQuery fancybox plugin
Related
I want to load more images in my website when I reach the bottom of my page. I'm using php and postgresql as my database.
For this post I simply load some text instead of image. I can write the code for it's equivalent.
So currently, I'm using a button at the bottom of my page, which when pressed re-loads the page and gives you more images(I'm displaying 50 images at a time).
But there are 2 problems with it, one being that the user will have to press the button again and again while I want it to happen automatically.
And the second one being that when new images are loaded, the previous ones are gone. I don't want to happen. For eg., if currently 1-50 images are present, my page later changes it to 51-100 while I want it to have all 1-100. I'm unable to solve this.
Please help. Thanks!
What you are looking for is commonly referred to as "infinite scroll pagination", while what you're asking for is techniclly possible using only PHP it would be a terrible user experience, as each reload would take the user to the top, and they would constantly have to continuously scroll further and further just to reach the location they were previously at.
Alternatively, handle this with JavaScript, an example: https://infinite-scroll.com/demo/full-page.
Doing simple Google searches reveals a plethora of options for JavaScript and JQuery plugins to achieve this.
An alternative, without the need for a plugin you can implement the answer to this:infinite-scroll jquery plugin
Simply call your PHP code in the form of an AJAX request when the bottom of the page is reached and append your new results. (this could be easily achieved with vanilla javascript as well).
Hope this helps.
I want a PHP page that triggers a popup on pageload, and then redirects to another (3rd party) page while the popup is in the foreground. Is this possible with PHP (and perhaps plain JavaScript).
Of course it is possible. You should make simple pop up with javascript but if you want to load a page beneath it the page should open in iframe ( at least that's the most simple way I can think of )
I built in a jQuery collapsible plugin into my fixed header. (You can click the button in the right upper corner to open it)
My problem is as following, when I open the page, reload or click on a link it automatically opens for a second. I would like it stops doing that and instead only opens when someone actually clicks on the button.
I don't know which part of my code to add here so I uploaded both files.
Here is the code to the php file
Here is the code to the jQuery file
I'm sorry for the inconvenience. I am new to this website and I just started building my own website but I'm willing to learn.
Regards
Try setting the container that holds the content to display:none in your css file to begin with.
Then when the button is clicked change the display value. You may not need to change the display value here as the jQuery which activates and shows it just now may work fine.
here's my problem, I want to make a panel ..that appear on the present page. In there, i ll put the description of a product. There will be a X to close the window and it will come back (with no refresh) at the present page. I tried to search but i don't find a way to do it.
ok then, i tought about an javascript alert() but it won't work. Else, I tought about a window.open() in javascript but i didn't want a new open Browser.I just need an idea or an element to know where i need to search
This panel is preferably done in PHP JAVASCRIPT HTML CSS,
Thanks to help me.
I think what your talking about is a lightbox
try this
http://leandrovieira.com/projects/jquery/lightbox/
I have this problem to solve.
I gonna make an email campaign to my clients with some affiliate promotions.
The email will have some direct links to the promotions that goes through a php script in my site. (ex: http://mysite.com/promo.php?promoId=x)
In this script I will manage my database queries and cookie.
In cases that I detect through the cookie that this user has not made any click in the last x days I would like to present him with two html pages: my main website page and the external site referring to the promo.
How can I do this? I currently use header( "Location: $promo_url" ) to redirect to the promo url... but in same cases stated before I would need two urls to open.
Thanks in advance for all your answers
GS
You can either use frames (ugh), an iframe within the main page to display the second page (somewhat less ugh), or use popup windows (truly ugh, and probably not possible due to everyone having popup blockers these days).
You could have the script output JavaScript with window.open instead.
<script type="text/javascript">
window.open("link1"); // open link1 in a separate window
window.location.href = "link2"; // point this window to link2
</script>
If you can, however, it would be much better to explicitly show the user a link to the second location somewhere on the page instead of forcefully opening another window / tab for them.
Show them your site, and in your site have a hidden a link tag, which will link to the affiliate site with the attribute _blank. Using jQuery, once the DOM is ready trigger a click event to the hidden link tag.
E.x.
HTML
<a id="affiliateLink" href="http://www.affiliatesite.com/asdad" target="_blank" style="display:none;">Visit Affiliate</a>
JavaScript
$(document).ready(function(){
$('#affiliateLink').trigger('click');
});
There's really no good way to do what you want without using iframes (ugh) or popups (double ugh). The other answers are how to use those techniques, but a possible 'better' solution would be to display a banner on your page when you detect the user hasn't been to your site in a while. The banner could say something along the lines of Click here for information about our awesome promotion, and it'd be easy to make it stand out. That way, you're not forcing popups (which no one will ever see), and while iframes aren't terrible from a user perspective, they don't really scream "modern web design".