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.
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.
it could be a stupid question, but I just can't find the answer to it. A few minutes ago I installed WPForms to create a contact form for my website. The setup went fine, I have checked it multiple times, but it won't display on my page.
I am using my own child theme from mh-magazine-lite.
The link to the website: http://st359450.cmd16c.cmi.hanze.nl/drimble/contact/ (Please note it's the first wp website my group has ever made for a school project, so it's not great)
Why can't I see the form on my page?
Navigate to the back-end of your WordPress website. (That's usually yoururl/wp-admin.)
In the menu that's on the left-hand side of the page, you should see a tab that says WPForms. Hover over that tab, then click add new.
When you finish customizing the form, copy the embed code (top right | next to save button), it should look something like this:[wpforms id="1712"]
Once you copy the code, go to the desired page you want to post the form on,
and click edit page.
Once you're in the editor, make sure the Text tab is selected, not the Visual tab. Paste the embed code in there. It should work then
Hope this helps.
The form is already added to your webpage. The reason you can not see it is that the code has been commented. So in the plugin settings check whether there's an option to activate or visible the form. Or if you can edit the html code in the relevant page remove <!-- before and --> after the form.
I have a classic php controller that gets the page name from the url and displays that page under my header section where my slideshow lives.Every time a press a link the slideshow restarts from the fisrt photo again or its killed while sliding and image.I know that the cause of that is that everytime time a link is given to the browser all the page is beeing proccesed again .
I know a few ways to go arround the problem using Ajax but the only problem with that is that the url will not change because it will be Async..I want to keep my url so my visitors are able to share the links they want.
An example site is at http://sounds.beatport.com where you press a sample to play , it loads it at the top and then you can browse thru the styles drop down menu changing links but yet the sample keeps playing..
So what i want to achive is having a div with my slideshow plugin keep playing at the top of my site without restarting while the visitors browse thru the site;
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
How can I determine if a page is opening in an overlay or in a browser window?
To be more exact, it's download page behavior from GitHub: if you click on the Downloads button from this page, it will open a facebox overlay. However, if you copy the address from the respective link and paste it into a new tab, it will open as a new page.
So how do you check to see where is the page opening (assuming PHP)?
Edit:
This was what I was looking for.
I think you need to do the checking on the client using JavaScript and PHP is not going to help you on this one. As far as I can tell from your post you need figure out how the page is loaded. Probably it is an iframe or such. Of that you must be able to retrieve the loaded address.
I don't know why you would want to check that, but as you can see the link has an id="download_button". And in the bundle_hithub.js file the download_button is associated with the popup event. I don't know how exactyly, it's hard to read those single-line compressed JS files.
if the page that is going to be loaded has the following script
<script type="text/javascript">
window.location = "http://page-loads";
</script>
it won't run when loaded through an ajax call (since the page will most likely be appended with an innerHTML way resulting in the script being appended in the document, but not ran)
but when opened solely in the browser window - the script will run taking the user away to the desired destination!