Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A couple of problems

    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.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Target

    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.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New Coder
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    none of my links into any iframe's work

    :cry:

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Instead of
    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>
    try this
    Code:
    <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
    Code:
    <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.
    Code:
    <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.
    Last edited by _Aerospace_Eng_; 09-21-2006 at 04:55 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New Coder
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    loadintoFrame() doesn't seem to be defined but I think it would be easier and more accessible if you just did this
    Code:
    //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/
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New Coder
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks i will use that, cheers mate


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •