|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Same div tag through several html pages... please help.
HI,
I have several simple html pages and the footer. I want to ask if it's impossible to make the footer div tag the same in all html pages. I don't how to explain properly, but it is like inline frames, but conversely. I want this, because my footer has a little flash player and when you enter the site it's automatically playing songs, but when I am going through pages it's playing from the beginning and I want, that it plays continuosly... Or maybe is another way to play song continuosly on the site? |
|
#2
|
|||
|
|||
|
You would need frames for that.
|
|
#3
|
||||
|
||||
|
I usually do this thru the server side, so i don't know if there is a better way to do this, but the following should work for you:
<iframe src="footer.htm" width="100%" height="50" scrolling="no" frameborder="0">
__________________
The liver is evil and must be punished! |
|
#4
|
|||
|
|||
|
Ok. If I put this code into pages (home.html, contacts.html, services.html, ...) than if I walk through pages this code should also reload or not?
(if this code will reload, than my music also reload and play from the beginning, which I don't want to be that) <iframe src="footer.htm" width="100%" height="50" scrolling="no" frameborder="0"> |
|
#5
|
||||
|
||||
|
yeah, if you never want the song to stop, then just use a regular frame.
|
|
#6
|
||||
|
||||
|
Automatically playing music is one of the most annoying things that can be on a web site. The best solution is to use a popup-window.
Reasons to Avoid Frames and iFrames My Top Ten List Of Extremely Annoying Web Page Design Elements! Ten Annoying Website Design Mistakes
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions IE7: the generation 7 browser new in a world of generation 8 browsers. Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. |
|
#7
|
|||
|
|||
|
Could you provide me an example on my footer.html to regular frames, that don't refreshes going trhough pages?
Sorry, I am new in html, just want to solve this problem... Thanks |
|
#8
|
||||
|
||||
|
|
|
#9
|
|||
|
|||
|
Ok, IT doesn't work for me. This time I decided to use, I think, more simple way to do that. It should work also great with a popup window. But I have one problem: my site contains a lot of liks. I use a javascript tree menu. For example home (link1, link2, link3), services (link4, link5, link6), downloads (link7, link8, link9). In these large 3 pages (home, services, downloads) play different music. So, I should in the each link... page add a JS popup window, yes? I ahve done that, but when I press, for example, link1 and then link3, which plays tha same music, it opens the popup again. Two times the same music.
Is any way to make the same popup window not open? |
|
#10
|
|||
|
|||
|
Leave the popup to happen onload. Then just check to see if it's there. Or on popup load, set a cookie. If cookie is set then don't do the onload for other pages.
|
|
#11
|
|||
|
|||
|
I found this popup script. But it works only for browser session.
Code:
<script type="text/javascript">
var popurls=new Array()
popurls[0]="http://www.sitename.com"
function openpopup(popurl){
var winpops=window.open(popurl,"","width=,height=")
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadornot(){
if (get_cookie('jkpopup')==''){
openpopup(popurls[Math.floor(Math.random()*(popurls.length))])
document.cookie="jkpopup=yes"
}
}
loadornot()
</script>
How, can I change this to work cookie in different pages? |
|
#12
|
|||
|
|||
|
Maybe is some "if" statement? I don't learn javascript, but for example - ''if the site 'http://sitename.com' is loaded, then popup will not open again"?
|
|
#13
|
|||
|
|||
|
Maybe is some "if" statement? I don't learn javascript, but for example - ''if the site 'http://sitename.com' is loaded, then popup will not open again"?
Anyway, thanks guys for help |
|
#14
|
|||
|
|||
|
Use this method to get the location. I won't give you the exact example since I haven't done JS in a while.
Code:
<script type="text/javascript">
if (document.home.src ="http://www.gameyin.com/whatever.html") {
//do someting
}
else {
//do something else
}
</script>
|
|
#15
|
|||
|
|||
|
I found that this code fits to me, but it has to be fixed.
Code:
<script type="text/javascript">
var popurls=new Array()
popurls[0]="music/dance.html"
popurls[1]="music/dj.html"
popurls[2]="music/hiphop.html"
function openpopup(popurl){
var winpops=window.open(popurl,"","width=370,height=10")
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadornot(){
if (get_cookie('jkpopup')==''){
openpopup(popurls[Math.floor(Math.random()*(popurls.length))])
document.cookie="jkpopup=yes"
}
}
loadornot()
</script>
When I press one page, and another and another page with the same popup url (for example dj.html) it makes no changes, which is good. Because it's not refreshing and music is playing continously. But I want that it would refresh, if I press another page with different popup link (for example music/dance.html) Is it possible? |