Jquery browsers' back button behaviour
Page 1 of 114 Replies - 551 Views - Last Post: 21 January 2013 - 07:13 AM
#1
Jquery browsers' back button behaviour
Posted 21 January 2013 - 01:43 AM
Now, when you've clicked some buttons on the products page, and then you use the browsers' back button it goes back to all the states (expanded, collapsed) of that page. What I really want is to go back to the previous page (e.g. index.php).
Is there a way to force the backbutton to point a particular url? Even a fixed url (index.php) would do (if the history(-1) is impossible).
Thank you all. Please have a look at http://www.mystere-eu.com
Click on 'Products', and choose one ('details' button) and then try the back button of your browser.
I'd really appreciate your help
Replies To: Jquery browsers' back button behaviour
#2
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 02:15 AM
They don't need to be links. Just use SPAN or DIV, etc., with :hover, etc., in the css, if required.
#3
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 02:21 AM
#4
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 02:47 AM
header("location:index.php");
regards,
Raghav
#5
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 04:05 AM
so I removed all the links, and assigned the jquery commands to the divs. Still no luck.
#6
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 04:51 AM
#7
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 05:10 AM
It's been removed now, but still no luck.
Is there a way to alter the browser's history list with Javascript?
#8
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 05:22 AM
ivanhaentjens, on 21 January 2013 - 05:10 AM, said:
It's been removed now, but still no luck.
Is there a way to alter the browser's history list with Javascript?
Well that file tells you that, yes! Javascript can modify the browser's history. Mozilla link.
You could post the specific code that runs when the details button is clicked (I gave up hunting for it). It seems to be doing something odd as I can see that the address flashes with a number 1 attached to the end. Perhaps some weird trick to persuade it to scroll (navigating to id #1 and then removing this 1 from the url).
#9
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 05:23 AM
#10
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 05:24 AM
This post has been edited by andrewsw: 21 January 2013 - 05:25 AM
#11
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 05:39 AM
still no luck
BTW: guys, your generosity strikes me.
Whatever you do comes back to you, they say.
May that be the case for you :-)
When you click the upper detail button, the following gets executed:
$("#ampsone .btndetails").click(function(){
$(".ampexpanded").hide();
$(".ampcollapsed .amptext").css("color","#666");
$(".ampcollapsed").show();
$("#ampsone").hide(function() {
$("#ampsone-expanded").slideDown('normal', function(){
$("#ia11images").attr('src', 'imagesia11.php');
$('html, body').animate({ scrollTop: $('#ampsone-expanded').offset().top }, 'slow');
});
});
});
in other words = collaps all open divs, open the current one you clicked, and scroll to top
This post has been edited by Dormilich: 21 January 2013 - 05:41 AM
Reason for edit:: please use [code] [/code] tags when posting code
#12
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 05:42 AM
#13
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 06:18 AM
//$("#ia11images").attr('src', 'imagesia11.php');
all works fine. What this does is change the iframe source to a php file imagesia11.php
That iframe contains the product slide show (and i don't want to run all hidden slide shows too),
so for the collapsed divs the src is set to emptywhite.php en for the expanded one to imagesia11.php, or imagesia12.php, ...
It's now commented.
So, does this mean that changing the src of an iframe adds a new entry in the browsers history?
#14
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 06:53 AM
when page loads : the emptywhite.php page is loaded in the iframe
when you click on the upper details button: the src of the iframe is set to imagesia11.php
when hitting the browser back button, not the products page but the iframe page goes back in history (to emptywhite.php)
#15
Re: Jquery browsers' back button behaviour
Posted 21 January 2013 - 07:13 AM
So I changed all iframes to div's and I use the load command (instead of src attr)
$("#ia11images").load("imagesia11.php");
Well, I learned something. I hope you did too, so I didn't waste your time.
Ivan
|
|

New Topic/Question
Reply


MultiQuote




|