how facebook redirect you on /photo.php? when you click on a photo and at the same time in the background is still the page you was before

+3 Yannis Sp · July 13, 2014
To be more specific i can't understand how you are on photo.php and in the background you are on your profile.php.I want to do that effect on my site so users can bookmark their photos.Thank you :)

Post a Reply


Oldest  Newest  Rating
+3 Samuel Oloruntoba · July 21, 2014
then you need to the learnt the window,history html5 property, i am pretty sure that is how facebook does it, when i used the window,history property, the page does not reload but the url changes
+1 Yannis Sp · July 20, 2014
Yes but the url doesn't change.Probably it's an Jquery API that does this(url change is important).
0 Joseph Mancuso · July 19, 2014
What i usually do to set a kind of "foreground" is use a dialog box or a modal window.

Jquery is what i use to create these dialog boxes. Links at the bottom of this post

For example, if i click a link, i can have a div pop up in a dialog box that i can use to do whatever i like without ever leaving the page. 

Its as easy as setting a div to display: none and then when a button is clicked, show that div inside of the dialog box.

I did this on my site to view trade offers while scrolling through the list. You can set attributes inside whatever you want your user to click on like:

<span class="photos" photo-name="userPhoto.jpg" from-user="Mike">Click me for more info!</span>

when a user clicks your link, use javascript to change the variables in the dialog div to values of the attributes inside your span element.

Heres a link for more info on dialog boxes:
  • 1

HTML / CSS / Web Design


Discuss, share, ask, learn and teach HTML5 and CSS3.