...

View Full Version : A couple of problems



KevinKeegan
09-20-2006, 09:12 PM
Hello, my site, being made now... http://www.fc-manager.co.uk/

Problem 1 //

The link for "forums" opens the forums in a new page. I want them to open in the iframe that is on my main page. Everything downwards from that menu/banner at the top is an iframe, but i cant get it to open in that frame.

Problem 2 //

Bottom right - select a league table. The drop down menu options i want to load in the frame below which contains the table. But when you click it opens in a new page.

----------------

Thanks in advance.:thumbsup:

ronaldb66
09-21-2006, 08:35 AM
I believe that if you give your iframe a name, you should be able to load a linked page in it using the target attribute on the a element.

The other stuff seems to be done with JavaScript; by the way, the vacancies and fixtures thingies don't work either: instead of changing to the selected choice, they reload the main iframe.

KevinKeegan
09-21-2006, 10:48 AM
i do have frame id's, but it's not working.

This is the drop down menu code :


<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<a><option value="premtable.htm" target="tableframe" selected>Premiership</option></a>
<a><option value="champtable.htm" target="tableframe">Chamionship</option></a>
</select>

With this iframe code :


<IFRAME NAME="tableframe" SRC="/premtable.htm" WIDTH=283 HEIGHT=316 FRAMEBORDER=0 SCROLLING=NO></IFRAME>

This is the forum link code


<a href="forums" target="myframe"><IMG SRC="images/index_04.gif" ALT="" WIDTH=79 HEIGHT=33 border="0"></a>

The iframe for that page is ;


<iframe id="myframe" src="/content.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>

it is iframe id instead of name because thats what dynamicdrive site says to put so the menu bar along the top works. If i change it the page doesnt work.



Any ideas? cheers

KevinKeegan
09-21-2006, 04:38 PM
none of my links into any iframe's work

:cry:

_Aerospace_Eng_
09-21-2006, 04:52 PM
Instead of

<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<a><option value="premtable.htm" target="tableframe" selected>Premiership</option></a>
<a><option value="champtable.htm" target="tableframe">Chamionship</option></a>
</select>
try this

<select name="menu1" onChange="parent.frames['tableframe'].location = this.options[this.options.selectedIndex].value">
<option value="premtable.htm" selected>Premiership</option>
<option value="champtable.htm">Chamionship</option>
</select>
As for this iframe

<iframe id="myframe" src="/content.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
You can still add the name to it.

<iframe id="myframe" name="myframe" src="/content.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
Now your links should work.

KevinKeegan
09-21-2006, 05:06 PM
THANKS VERY MUCH SIR, LEGEND!!!

now i have come across new problems, doh, lol.

The drop down menu's (example @ premiership click it) then when you click the club it doesnt appear. the code is...


//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Arsenal</a>'
menu1[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Aston Villa</a>'
menu1[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Blackburn Rovers</a>'
menu1[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Bolton Wanderers</a>'
menu1[4]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Charlton Athletic</a>'
menu1[5]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Chelsea</a>'
menu1[6]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Everton</a>'
menu1[7]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Fulham</a>'
menu1[8]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Liverpool</a>'
menu1[9]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Manchester City</a>'
menu1[10]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Manchester United</a>'
menu1[11]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Middlesbrough</a>'
menu1[12]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Newcastle United</a>'
menu1[13]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Tottenham Hotspur</a>'
menu1[14]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Portsmouth</a>'
menu1[15]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">West Ham United</a>'


which is proven to work on other sites i have made.

Full script for the dynamic drive menu =


<style type="text/css">

#dropmenudiv{
position:absolute;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}

#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
}

#dropmenudiv a:hover{ /*hover background color*/
background-color: black;
}

</style>

<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- &#169; Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Arsenal</a>'
menu1[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Aston Villa</a>'
menu1[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Blackburn Rovers</a>'
menu1[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Bolton Wanderers</a>'
menu1[4]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Charlton Athletic</a>'
menu1[5]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Chelsea</a>'
menu1[6]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Everton</a>'
menu1[7]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Fulham</a>'
menu1[8]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Liverpool</a>'
menu1[9]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Manchester City</a>'
menu1[10]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Manchester United</a>'
menu1[11]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Middlesbrough</a>'
menu1[12]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Newcastle United</a>'
menu1[13]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Tottenham Hotspur</a>'
menu1[14]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Portsmouth</a>'
menu1[15]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">West Ham United</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Birmingham City</a>'
menu2[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Coventry City</a>'
menu2[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Crystal Palace</a>'
menu2[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Leeds United</a>'
menu2[4]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Norwich City</a>'
menu2[5]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Preston North End</a>'
menu2[6]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Reading</a>'
menu2[7]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Sheffield United</a>'
menu2[8]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Southampton</a>'
menu2[9]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Sunderland</a>'
menu2[10]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Watford</a>'
menu2[11]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">West Bromwich Albion</a>'
menu2[12]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Wigan Athletic</a>'
menu2[13]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Wolvehampton Wanderers</a>'

//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Burnley</a>'
menu3[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Cardiff City</a>'
menu3[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Derby County</a>'
menu3[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Hull City</a>'
menu3[4]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Ipswich Town</a>'
menu3[5]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Leicester City</a>'
menu3[6]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Luton Town</a>'
menu3[7]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Plymouth Argyle</a>'
menu3[8]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Queens Park Rangers</a>'
menu3[9]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Sheffield Wednesday</a>'
menu3[10]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Southend United</a>'
menu3[11]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Stoke City</a>'

//Contents for menu 4, and so on
var menu4=new Array()
menu4[0]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Barnsley Town</a>'
menu4[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Bradford City</a>'
menu4[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Brentford</a>'
menu4[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Brighton and Hove Albion</a>'
menu4[4]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Crewe Alexandra</a>'
menu4[5]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Doncaster Rovers</a>'
menu4[6]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Huddersfield Town</a>'
menu4[7]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Millwall</a>'
menu4[8]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Nottingham Forest</a>'
menu4[9]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Scunthorpe Town</a>'

//Contents for menu 5, and so on
var menu5=new Array()
menu5[0]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">F.A Cup</a>'
menu5[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">League Cup</a>'
menu5[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">The F.A Trophy</a>'
menu5[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Champions League</a>'
menu5[4]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">UEFA Cup</a>'
menu5[5]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">European Super Cup</a>'

var menuwidth='165px' //default menu width
var menubgcolor='lightyellow' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

//Contents for menu 6, and so on
var menu6=new Array()
menu6[0]='<a href="/forums">Forums</a>'
menu6[1]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Help</a>'
menu6[2]='<a href="javascript:loadintoIframe(\'myframe\',\'about.html\')">Search</a>'
menu6[3]='<a href="javascript:loadintoIframe(\'myframe\',\'transfers.html\')">Members</a>'
menu6[4]='<a href="javascript:loadintoIframe(\'myframe\',\'forums\')">TEST</a>'


/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

</script>


sorry to bother you

_Aerospace_Eng_
09-21-2006, 05:47 PM
loadintoFrame() doesn't seem to be defined but I think it would be easier and more accessible if you just did this

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="about.html" target="myframe">Arsenal</a>'
etc
etc
etc

Just put in the href and the target and thats it. Personally I would actually get a new menu. The one you have is bulky and uses way too much JS for a simple drop down. I would look into the suckerfish drop down menus http://alistapart.com/articles/dropdowns/

KevinKeegan
09-21-2006, 07:12 PM
ok thanks i will use that, cheers mate



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum