Jump to content

Having an iFrame that stays on the page no matter what.


mattal999

Recommended Posts

Hi guys,

 

I am trying to code a website that will end up kind of like www.we7.com.

 

Now I am trying to have my mp3 player (a seperate file) always on the page no matter where you navigate to without refreshing for continuous play.

 

This website does this brilliantly, but I can't seem to find a way to replicate it without making the page refresh. I have no code at the moment to show you, but how can I do this?

 

Thanks,

 

mattal999.

Yeah, I was going to do that, but then the page location at the top wouldn't change, and that wouldn't be very handy for URL sharing (which is a key part in this site).

 

I'm thinking of doing this:

 

Use Javascript to grab any content after a #/ in the url and use that to load a page using ajax or something like that?

[sorry Mods, can't edit the above post for some reason :P][/sorry]

 

Ok. Good news. I've managed to code some Javascript that loops through all hyperlinks in the page and gives them an onClick value. Now all I need to do is make the ajax on the function that is called (onClick()) that loads the new page into a div.

 

Looks like its gonna be a good day!

I've managed to do it very efficiently. Check out the example here:

 

http://www.imuzic.co.uk/alpha/

 

Feedback is appreciated. (By the way, I used ajax to load the pages, and try going straight to the disclaimer page - http://www.imuzic.co.uk/alpha/#/disclaimer.php)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.