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/
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'm building a site where there will be four tiles on the front page. When a tile is selected, I want the content to pop up in like a window that will be a bit transparent so you can see the main page behind it.
I've successfully coded just that, getting the link to bring up another div that is otherwise hidden and I've even gotten it to load another html document. I accomplished this with XMLHttpRequest();. My question is, is there a more efficient way to do this? I know I've done something similar in PHP before in school and when I google, I do see that being a way to do it, but I'm also seeing jQuery and AJAX being mentioned. My overall goal is to get it to where if I want to update the CSS of the screens, that I only have to do that for the main page, and it affects the content pop-ups.
I hope I explained this well enough. Thank you for any advice!
It's very simple to do in jQuery:
$("#yourDivsId").load("/UrlOfYourIntendedMarkupDelivery?anyarguments=true");
I know this has been asked by a few people but I haven't seen the answer. I have a php upload form for a file upload in a div tag. Is it possible to submit the form and upload the file without a page refresh? I haven't found the plugins to work because I want to submit the form with a title and other data attached as well. Any suggestions? I looked at using an iframe, but i'm not sure it will work in an upload.php wrapped in a div tag?
Here is the most simple solution you can use: Image upload without page refresh.
No obligation to use the javascript part, but it gives you the opportunity to show a notice that the transfer has been correctly done.
If you are open to jQuery and want a more open solution, I suggest you to take a look at the jQuery Form Plugin that can manage it all for you, with some extras that could be interesting.
My favourite tool for this is Uploadify. It includes real-time progress indicators, drag-and-drop, etc.
There are other, older solutions as well, including this one. That page has a simple demo that may provide a good example for how to do this on your own.
Honourable mention goes to Dave Walsh's facebook-lightbox, into which you might be able to put a file upload form. Worth a try if you like the look.
Try using something like AIM (http://www.webtoolkit.info/). And you should really get a little more experience on html, php and js.
I want my site to have similar navigation to a browser. I want visitors to be able to right click on one of my links/articles and have the option to open a new tab and have the page load in the same page. Here is the concept site I want to work with link.
Well, then try to use dynamically injected <iframe>. Especially when using JQuery it could be very easy solution. You must also somehow manipulate the links inside the content... look at this link if it helps, hope you won't have problems with "same origin policy".
You have to use some ajax function to load content from the new page into the tab.
Sounds like this would be a good scenario to use a AJAX, for ease of use I would recommend JQuery.
hi im using ajax to extract all the pages into the main page but am not being able to control the refresh , if somebody refreshes the page returns back to the main page can anybody give me any solutions , i would really appreciate the help...
you could add anchor (#something) to your URL and change it to something you can decode to some particular page state on every ajax event.
then in body.onload check the anchor and decode it to some state.
back button (at least in firefox) will be working alright too. if you want back button to work in ie6, you should add some iframe magic.
check various javascript libraries designed to support back button or history in ajax environment - this is probably what you really need. for example, jQuery history plugin
You can rewrite the current url so it gives pointers to where the user was - see Facebook for examples of this.
I always store the 'current' state in PHP session.
So, user can refresh at any time and page will still be the same.
if somebody refreshes the page returns back to the main page can anybody give me any solutions
This is a feature, not a bug in the browser. You need to change the URL for different pages. Nothing is worse then websites that use any kind of magic either on the client side or the server side which causes a bunch of completely different pages to use the same URL. Why? How the heck am I gonna link to a specific page? What if I like something and want to copy & paste the URL into an IM window?
In other words, consider the use cases. What constitutes a "page"? For example, if you have a website for stock quotes--should each stock have a unique URL? Yes. Should you have a unique URL for every variation you can make to the graph (i.e. logarithmic vs linear, etc)? Depends--if you dont, at least provide a "share this" like google maps does so you can have some kind of URL that you can share.
That all said, I agree with the suggestion to mess with the #anchor and parse it out. Probably the most elegant solution.