Avatar billede craver35 Nybegynder
26. april 2012 - 13:08 Der er 3 kommentarer og
1 løsning

Hjælp til dropdown menubar.

Hej Eksperter.

Jeg har et problem på min side, jeg ønsker at erstatte en normal menubar med en drop down menubar, jeg har følgende kode på min index side, hvor det er med min normale menubar som kan ses på http://www.damnfun.dk

INDEX:

<?php include"header.php" ?>
    <div id="col_left_2" style="background:#fff">
    <div class="titre_index">Featured Videoes</div>
    <div id="une">
 
    <?php
    $q=mysql_query("select * from videos where feat=1 order by video_id  desc limit 0,2");
    while($video=mysql_fetch_assoc($q)){
   
    $youtubeid = str_replace("watch?v=","",end(explode("/",$video['video_url'])));
      $youtubeid = reset(explode("&",$youtubeid));
     
    $thumb = "http://img.youtube.com/vi/$youtubeid/1.jpg";
      $file = "http://www.youtube.com/v/$youtubeid";
      $vtext=substr($video['video_desc'],0,100)."...";
      $vtit=html_entity_decode(substr($video['video_title'],0,50))."...";
            echo '<div class="bloc_une">
                <img src="'.$thumb.'" alt="'.$vtit.'" height="96" width="128">
                <div class="titre_une">'.$vtit.'</div>
                <div class="txt_une">'.$vtext.'</div>
                <a href="'.$video['video_id'].'_'.str_replace(" ","-",substr(html_entity_decode(strtolower($video['video_title'])),0,20)).'.html" class="btn_voir"></a>
                </div>';
    }
    ?>
   
    </div>
   
      <div style="float:left; margin-top:0px;">
    <div class="titre_index">New Videoes</div>
   
      <?php MyVideo::getPublicSide(); ?>
                 
    </div>
   
   
   
    </div>
    <div id="col_right_2">
<div class="c_index">
<?php
$q=mysql_query("select * from ads where id=1");
$r=mysql_fetch_assoc($q);
echo $r['ad3'];

?>
</div>


  <div class="titre_bloc_index">Most popular</div>

    <?php
    $q=mysql_query("select * from videos order by views desc  LIMIT 10  ");
    while($video=mysql_fetch_assoc($q)){
   
    $youtubeid = str_replace("watch?v=","",end(explode("/",$video['video_url'])));
      $youtubeid = reset(explode("&",$youtubeid));
     
    $thumb = "http://img.youtube.com/vi/$youtubeid/1.jpg";
      $file = "http://www.youtube.com/v/$youtubeid";
     
            echo '<a class="a_bloc" href="'.$video['video_id'].'_'.str_replace(" ","-",substr(html_entity_decode(strtolower($video['video_title'])),0,20)).'.html">
                <div class="bloc">
                <img src="'.$thumb.'" alt="'.$vtit.'" height="60" width="80">
                <div class="txt">'.html_entity_decode($video['video_title']).'</div>
                </div></a>';
    }
    ?>
           
               

</div>
<?php include"footer.php" ?>




Jeg har fundet koden til min dropdown menubar som er:


<!-- *** MyCSSMenu copyright (c) 2007, MyCSSMenu. All Rights Reserved.

    -MyCSSMenu may be manually customized by editing this document, or open this web page using
    IE or Firefox to access the visual interface.

-->


<!--%%%%%%%%%%%% MyCSSMenu Styles [Keep in head for full validation!] %%%%%%%%%%%-->
<style type="text/css">


/*!!!!!!!!!!! MyCSSMenu Core CSS [Do Not Modify!] !!!!!!!!!!!!!*/
.qmmc .qmdivider{display:block;font-size:1px;border-width:0px;border-style:solid;position:relative;z-index:1;}.qmmc .qmdividery{float:left;width:0px;}.qmmc .qmtitle{display:block;cursor:default;white-space:nowrap;position:relative;z-index:1;}.qmclear {font-size:1px;height:0px;width:0px;clear:left;line-height:0px;display:block;float:none !important;}.qmmc {position:relative;zoom:1;z-index:10;}.qmmc a, .qmmc li {float:left;display:block;white-space:nowrap;position:relative;z-index:1;}.qmmc div a, .qmmc ul a, .qmmc ul li {float:none;}.qmsh div a {float:left;}.qmmc div{visibility:hidden;position:absolute;}.qmmc li {z-index:auto;}.qmmc ul {left:-10000px;position:absolute;z-index:10;}.qmmc, .qmmc ul {list-style:none;padding:0px;margin:0px;}.qmmc li a {float:none}.qmmc li:hover>ul{left:auto;}#qm0 ul {top:100%;}#qm0 ul li:hover>ul{top:0px;left:100%;}


/*!!!!!!!!!!! MyCSSMenu Styles [Please Modify!] !!!!!!!!!!!*/


    /* MyCSSMenu 0 */

    /*"""""""" (MAIN) Items""""""""*/   
    #qm0 a   
    {   
        padding:5px 4px 5px 5px;
        color:#555555;
        font-family:Arial;
        font-size:10px;
        text-decoration:none;
    }


    /*"""""""" (SUB) Container""""""""*/   
    #qm0 div, #qm0 ul   
    {   
        padding:10px;
        margin:-2px 0px 0px;
        background-color:transparent;
        border-style:none;
    }


    /*"""""""" (SUB) Items""""""""*/   
    #qm0 div a, #qm0 ul a   
    {   
        padding:3px 10px 3px 5px;
        background-color:transparent;
        font-size:11px;
        border-width:0px;
        border-style:none;
    }


    /*"""""""" (SUB) Hover State""""""""*/   
    #qm0 div a:hover, #qm0 ul a:hover   
    {   
        background-color:#DADADA;
        color:#CC0000;
    }


    /*"""""""" (SUB) Active State""""""""*/   
    body #qm0 div .qmactive, body #qm0 div .qmactive:hover   
    {   
        background-color:#DADADA;
        color:#CC0000;
    }


    /*"""""""" Individual Titles""""""""*/   
    #qm0 .qmtitle   
    {   
        cursor:default;
        padding:3px 0px 3px 4px;
        color:#444444;
        font-family:arial;
        font-size:11px;
        font-weight:bold;
    }


    /*"""""""" Individual Horizontal Dividers""""""""*/   
    #qm0 .qmdividerx   
    {   
        border-top-width:1px;
        margin:4px 0px;
        border-color:#BFBFBF;
    }


    /*"""""""" Individual Vertical Dividers""""""""*/   
    #qm0 .qmdividery   
    {   
        border-left-width:1px;
        height:15px;
        margin:4px 2px 0px;
        border-color:#AAAAAA;
    }


    /*"""""""" (main) Rounded Items""""""""*/   
    #qm0 .qmritem span   
    {   
        border-color:#DADADA;
        background-color:#F7F7F7;
    }


    /*"""""""" (main) Rounded Items Content""""""""*/   
    #qm0 .qmritemcontent   
    {   
        padding:0px 0px 0px 4px;
    }


</style><!-- Core MyCSSMenu Code -->
<script type="text/javascript">/* <![CDATA[ */var qm_si,qm_li,qm_lo,qm_tt,qm_th,qm_ts,qm_la,qm_ic,qm_ib;var qp="parentNode";var qc="className";var qm_t=navigator.userAgent;var qm_o=qm_t.indexOf("Opera")+1;var qm_s=qm_t.indexOf("afari")+1;var qm_s2=qm_s&&qm_t.indexOf("ersion/2")+1;var qm_s3=qm_s&&qm_t.indexOf("ersion/3")+1;var qm_n=qm_t.indexOf("Netscape")+1;var qm_v=parseFloat(navigator.vendorSub);;function qm_create(sd,v,ts,th,oc,rl,sh,fl,ft,aux,l){var w="onmouseover";var ww=w;var e="onclick";if(oc){if(oc=="all"||(oc=="lev2"&&l>=2)){w=e;ts=0;}if(oc=="all"||oc=="main"){ww=e;th=0;}}if(!l){l=1;qm_th=th;sd=document.getElementById("qm"+sd);if(window.qm_pure)sd=qm_pure(sd);sd[w]=function(e){qm_kille(e)};document[ww]=qm_bo;if(oc=="main"){qm_ib=true;sd[e]=function(event){qm_ic=true;qm_oo(new Object(),qm_la,1);qm_kille(event)};document.onmouseover=function(){qm_la=null;clearTimeout(qm_tt);qm_tt=null;};}sd.style.zoom=1;if(sh)x2("qmsh",sd,1);if(!v)sd.ch=1;}else  if(sh)sd.ch=1;if(oc)sd.oc=oc;if(sh)sd.sh=1;if(fl)sd.fl=1;if(ft)sd.ft=1;if(rl)sd.rl=1;sd.style.zIndex=l+""+1;var lsp;var sp=sd.childNodes;for(var i=0;i<sp.length;i++){var b=sp[i];if(b.tagName=="A"){lsp=b;b[w]=qm_oo;if(w==e)b.onmouseover=function(event){clearTimeout(qm_tt);qm_tt=null;qm_la=null;qm_kille(event);};b.qmts=ts;if(l==1&&v){b.style.styleFloat="none";b.style.cssFloat="none";}}else  if(b.tagName=="DIV"){if(window.showHelp&&!window.XMLHttpRequest)sp[i].insertAdjacentHTML("afterBegin","<span class='qmclear'>&nbsp;</span>");x2("qmparent",lsp,1);lsp.cdiv=b;b.idiv=lsp;if(qm_n&&qm_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";new qm_create(b,null,ts,th,oc,rl,sh,fl,ft,aux,l+1);}}};function qm_bo(e){qm_ic=false;qm_la=null;clearTimeout(qm_tt);qm_tt=null;if(qm_li)qm_tt=setTimeout("x0()",qm_th);};function x0(){var a;if((a=qm_li)){do{qm_uo(a);}while((a=a[qp])&&!qm_a(a))}qm_li=null;};function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};function qm_uo(a,go){if(!go&&a.qmtree)return;if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);};;function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));};function qm_oo(e,o,nt){if(!o)o=this;if(qm_la==o&&!nt)return;if(window.qmv_a&&!nt)qmv_a(o);if(window.qmwait){qm_kille(e);return;}clearTimeout(qm_tt);qm_tt=null;qm_la=o;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun){qm_kille(e);return;}if(qm_ib&&!qm_ic)return;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li)go=false;}if(qm_li&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li))qm_uo(qm_li);a=qm_li;while((a=a[qp])&&!qm_a(a)){if(a!=o[qp]&&a!=o.cdiv)qm_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.ft)ay=0;if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(qm_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(qm_s2&&!qm_s3){ax-=qm_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=qm_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);c.style.visibility="inherit";qm_li=c;}else  if(!qm_a(b[qp]))qm_li=b[qp];else qm_li=null;qm_kille(e);};function qm_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else  if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(qm_s&&e.type=="click"))e.stopPropagation();};function qm_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.qmpure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;qm_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="qmclear";csp.innerHTML="&nbsp;";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};function qm_convert(a,bm,l){if(!l)bm[qc]=a[qc];bm.id=a.id;var ch=a.childNodes;for(var i=0;i<ch.length;i++){if(ch[i].tagName=="LI"){var sh=ch[i].childNodes;for(var j=0;j<sh.length;j++){if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN"))bm.appendChild(ch[i].removeChild(sh[j]));if(sh[j]&&sh[j].tagName=="UL"){var na=document.createElement("DIV");var c;if(c=sh[j].style.cssText)na.style.cssText=c;if(c=sh[j].className)na.className=c;na=bm.appendChild(na);new qm_convert(sh[j],na,1)}}}}}/* ]]> */</script>

<!-- Add-On Core Code (Remove when not using any add-on's) -->
<style type="text/css">.qmfv{visibility:visible !important;}.qmfh{visibility:hidden !important;}</style><script type="text/JavaScript">var qmad = new Object();qmad.bvis="";qmad.bhide="";</script>


    <!-- Add-On Settings -->
    <script type="text/JavaScript">

        /*******  Menu 0 Add-On Settings *******/
        var a = qmad.qm0 = new Object();

        // IE Over Select Fix Add On
        a.overselects_active = true;

    </script>

<!-- Add-On Code: IE Over Select Fix -->
<script type="text/javascript">/* <![CDATA[ */if(window.showHelp&&!window.XMLHttpRequest){if(qmad.bvis.indexOf("qm_over_select(b.cdiv);")==-1){qmad.bvis+="qm_over_select(b.cdiv);";qmad.bhide+="qm_over_select(a,1);";}};function qm_over_select(a,hide){var z;if((z=window.qmv)&&(z=z.addons)&&(z=z.over_select)&&!z["on"+qm_index(a)])return;if(!a.settingsid){var v=a;while(!qm_a(v))v=v[qp];a.settingsid=v.id;}var ss=qmad[a.settingsid];if(!ss)return;if(!ss.overselects_active)return;if(!hide&&!a.hasselectfix){var f=document.createElement("IFRAME");f.style.position="absolute";f.style.filter="alpha(opacity=0)";f.src="java script:false;";f=a.parentNode.appendChild(f);f.frameborder=0;a.hasselectfix=f;}var b=a.hasselectfix;if(b){if(hide)b.style.display="none";else {var oxy=0;if(a.hasshadow&&a.hasshadow.style.visibility=="inherit")oxy=parseInt(ss.shadow_offset);if(!oxy)oxy=0;b.style.width=a.offsetWidth+oxy;b.style.height=a.offsetHeight+oxy;b.style.top=a.style.top;b.style.left=a.style.left;b.style.margin=a.currentStyle.margin;b.style.display="block";}}}/* ]]> */</script>

</head>

<body style="margin:40px;background-color:rgb(254, 254, 254);"><noscript><span style="font-size:13px;font-family:arial;"><span style="color:#dd3300">Warning!</span>&nbsp&nbsp; MyCSSMenu may have been blocked by IE-SP2's active content option. This browser feature blocks JavaScript from running locally on your computer.<br><br>This warning will not display once the menu is on-line.  To enable the menu locally, click the yellow bar above, and select <span style="color:#0033dd;">"Allow Blocked Content"</span>.<br><br>To permanently enable active content locally...<div style="padding:0px 0px 30px 10px;color:#0033dd;"><br>1: Select 'Tools' --> 'Internet Options' from the IE menu.<br>2: Click the 'Advanced' tab.<br>3: Check the 2nd option under 'Security' in the tree (Allow active content to run in files on my computer.)</div></span></noscript>

<!--Open Visual Interface Button-->
<a style="font-size:13px;color:#444444;font-family:arial;text-decoration:none;display:block;margin-bottom:25px;" id="qmv_open_visual_interface" href="java script:java script:if (qm_s3){window.name='qm_launch_visual';window.location = window.location.href;}else{var qmnw = window.open(window.location.href,'qm_launch_visual','scrollbars=no,location=no,status=yes,menu=no,toolbar=no,resizable=yes');if (window.focus) {qmnw.focus()}}"><span style="color:#dd3300;">
  • </span> Open Visual Interface</a>




<!-- MyCSSMenu Structure [Menu 0] -->

<ul id="qm0" class="qmmc">

    <li><a href="http://www.damnfun.dk">FORSIDEN</a></li>
    <li><span class="qmdivider qmdividery" ></span></li>
    <li><a class="qmparent" href="http://www.damnfun.dk">VIDEOER</a>

        <ul>
        <li><a href="http://damnfun.dk/category-biler-34-1.html">Biler</a></li>
        <li><a href="http://damnfun.dk/category-crazy%20-39-1.html">Crazy</a></li>
        <li><a href="http://damnfun.dk/category-funny-22-1.html">Funny</a></li>
        <li><a href="http://damnfun.dk/category-hot-35-1.html">Hot</a></li>
        <li><a href="http://damnfun.dk/category-reality%20-37-1.html">Reality</a></li>
        <li><a href="http://damnfun.dk/category-reklamer%20-41-1.html">Reklamer</a></li>
        <li><a href="http://damnfun.dk/category-sexy-36-1.html">Sexy</a></li>
        <li><a href="http://damnfun.dk/category-skjult%20kamera%20-42-1.html">Skjult kamera</a></li>
        <li><a href="http://damnfun.dk/category-sport-23-1.html">Sport</a></li>
        <li><a href="http://damnfun.dk/category-tv-38-1.html">TV</a></li>
        </ul></li>

    <li><span class="qmdivider qmdividery" ></span></li>
    <li><a class="qmparent" href="http://www.damnfun.dk/gamesite">SPIL</a>

        <ul>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=2">Actionspil</a></li>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=1">Arkadespil</a></li>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=14">Brætspil</a></li>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=15">Klassikere</a></li>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=16">Kort &amp; Poker</a></li>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=17">Strategi spil</a></li>
        <li><a href="http://damnfun.dk/gamesite/?page=browse&category=23">Voksen spil</a></li>
        </ul></li>

    <li><span class="qmdivider qmdividery" ></span></li>
    <li><a href="http://www.damnfun.dk/contact.html">KONTAKT</a></li>
    <li><span class="qmdivider qmdividery" ></span></li>
<li class="qmclear">&nbsp;</li></ul>

<!-- Create Menu Settings: (Menu ID, Is Vertical, Show Timer, Hide Timer, On Click ('all' or 'lev2'), Right to Left, Horizontal Subs, Flush Left, Flush Top) -->
<script type="text/javascript">qm_create(0,false,0,250,false,false,false,false,false);</script>


<!-- This script references optionally loads the MyCSSMenu visual interface, to run the menu stand alone remove the script.-->
<script type="text/javascript">if (window.name=="qm_launch_visual"){document.write('<scr'+'ipt type="text/javascript" src="http://www.mycssmenu.com/qmv6/qm_visual.js"></scr'+'ipt>')}</script>




Mit problem er bare at når jeg sætter den her kode ind istedet for min menubar, så laver den ikke dropdown funktionen, nogle der kan hjælpe?

Mvh. Jeppe S
Avatar billede craver35 Nybegynder
26. april 2012 - 13:09 #1
Håber i kan hjælpe mvh. Jeppe S
Avatar billede olsensweb.dk Ekspert
26. april 2012 - 14:02 #2
spørgsmålet havde nok været bedre plaseret i CSS kategorien jeg vil anbefale dig at flytte spm derover.
det var dog en frygtelig masse code for så lidt, tag et kig på http://www.w3schools.com/css/css_navbar.asp
Avatar billede olsensweb.dk Ekspert
26. april 2012 - 15:19 #3
jeg ser du har flyttet spm til http://www.eksperten.dk/spm/961942
læg selv et svar her, og accepter så spm lukkes
Avatar billede craver35 Nybegynder
27. april 2012 - 11:25 #4
LUKKET
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester