Zoque.Forum
»
frame ve form dan etkilenmeyen Menu
|
| Script Bölümü Kendi yazmış olduğunuz dhtml, java script uygulamalara ya da sunucu tabanlı çalışan programlara bu bölümde yer verebilirsiniz. |
![]() |
|
|
LinkBack | Seçenekler |
|
|
#1 (permalink) |
|
Üyelik Tarihi: 22.06.2001
Yer: Antalya
Yaş: 38
Mesaj: 531
|
Özellikler:
ie5,5+ çalışır alta açılan linkler şeklindedir. form elemanlarından, frame ve iframe den etkilenmez (altında kalmaz) her link ve altlink ayrı ayrı dilediğiniz gibi biçimlendirilebilinir kullanımı ve biçimlendirmesi kolaydır Sayfada konumlandırılması: sayfanın dilediğiniz bir yerine alttaki kodlar yardımı ile yerleştirilebilinir. JavaScript ile Kod:
<script language="JavaScript"> var menuxml = new ActiveXObject("Microsoft.XMLDOM"); menuxml.async = false; menuxml.load("menu.XML"); var menuxsl = new ActiveXObject("Microsoft.XMLDOM"); menuxsl.async = false; menuxsl.load("menu.xsl"); document.write(menuxml.transformNode(menuxsl)); </script> Kod:
<% Dim menuxml Dim menuxsl Set menuxml = server.CreateObject("Microsoft.XMLDOM") menuxml.async = false menuxml.load(server.MapPath("menu.XML")) Set menuxsl = server.CreateObject("Microsoft.XMLDOM") menuxsl.async = false menuxsl.load(server.MapPath("menu.xsl")) Response.Write(menuxml.transformNode(menuxsl)) %> menu.xsl dosyası (bu dosya sabitdir değişliğe gerek yoktur) Kod:
<?XML version="1.0" encoding="iso-8859-9"?> <!-- Biolight 2003 (biolight@mynet.com) --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <script language="JavaScript"> <xsl:comment> <![CDATA[ /* Biolight 2003 (biolight@mynet.com) */ var menu = window.createPopup(); function FrameMenu(gelen) { hidePopup(); var soldan = document.getElementById(gelen).offsetLeft; var ustten = document.getElementById(gelen).offsetTop+document.getElementById(gelen).offsetHeight; if(parent.frames[1]){ustten=ustten-4;} else{soldan=soldan+2;ustten=ustten+2;} var neresi=gelen+"1"; if(document.getElementById(neresi)){ document.getElementById(neresi).style.display="block"; var en=document.getElementById(neresi).offsetWidth; var boy=document.getElementById(neresi).offsetHeight; document.getElementById(neresi).style.display="none"; menu.document.body.innerHTML ="<table cellpadding=\"0\" cellspacing=\"0\">"+document.getElementById(neresi).innerHTML+"<\/table>"; menu.show(soldan,ustten,en,boy,document.body);} } function hidePopup(){if(menu){menu.hide()};} menu.document.body.onmouseleave = hidePopup; function git(adres,yer) { if(yer==""){location.href=adres;} else{ if(yer=="top"){parent.location.href=adres;} else{ if(yer=="blank"){window.open(adres,"","directories=no,toolbar=yes,location=yes,status=yes,scrollbars=yes" +",resizable=yes,menubar=yes");} else{ if(parent.frames[yer]){parent[yer].location.href=adres;} else{window.open(adres,"","directories=no,toolbar=yes,location=yes,status=yes,scrollbars=yes" +",resizable=yes,menubar=yes");} }}}} ]]> // </xsl:comment> </script> <xsl:for-each select="xmlmenu/menu/link"> <span> <xsl:attribute name="id">MenuNo<xsl:number value="position()" format="1"/></xsl:attribute> <xsl:attribute name="style">cursor:hand;color:#ffffff;background-color:#6699cc;font-family:verdana,sans-serif; font-size:10px;font-weight:bold;padding:5px;<xsl:value-of select="style" />;</xsl:attribute> <xsl:attribute name="onmouseover">this.style.backgroundColor='<xsl:value-of select="hoverbgcolor" />';this.style.color='<xsl:value-of select="hovercolor" />';FrameMenu('MenuNo<xsl:number value="position()" format="1"/>');</xsl:attribute> <xsl:attribute name="onmouseout">this.style.backgroundColor='<xsl:value-of select="bgcolor" />'; this.style.color='<xsl:value-of select="color" />';</xsl:attribute> <xsl:attribute name="onclick">FrameMenu('MenuNo<xsl:number value="position()" format="1"/>');</xsl:attribute> <xsl:value-of select="isim" /> </span> <table cellpadding="0" cellspacing="0" style="display:none"> <xsl:attribute name="id">MenuNo<xsl:number value="position()" format="1"/>1</xsl:attribute> <tbody> <tr><td> <xsl:for-each select="altlink"> <div> <xsl:attribute name="onclick">parent.git('<xsl:value-of select="adres" />','<xsl:value-of select="target" />');</xsl:attribute> <xsl:attribute name="style">cursor:hand;color:#ffffff;background-color:#6699cc;font-family:verdana,sans-serif; font-size:10px;font-weight:bold;padding:3px 5px 3px 5px;border-bottom:2px solid <xsl:value-of select="hoverbgcolor" />;<xsl:value-of select="style" />;</xsl:attribute> <xsl:attribute name="title"><xsl:value-of select="title" /></xsl:attribute> <xsl:attribute name="onmouseover">this.style.backgroundColor='<xsl:value-of select="hoverbgcolor" />';this.style.color='<xsl:value-of select="hovercolor" />';</xsl:attribute> <xsl:attribute name="onmouseout">this.style.backgroundColor='<xsl:value-of select="bgcolor" />';this.style.color='<xsl:value-of select="color" />';</xsl:attribute> <xsl:value-of select="isim" /> </div> </xsl:for-each> </td></tr> </tbody></table> </xsl:for-each> </xsl:template> </xsl:stylesheet> Kod:
<?XML version="1.0" encoding="windows-1254"?> <xmlmenu> <menu> <link> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link1</isim> <altlink> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link1-1</isim> <title>Link1-1 (href=menu.XML target=yok)</title> <adres>menu.XML</adres> <target></target> </altlink> <altlink> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link1-2</isim> <title>Link1-2 (href=menu.XML target=top)</title> <adres>menu.XML</adres> <target>top</target> </altlink> </link> <link> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link2</isim> <altlink> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link2-1</isim> <title>Link2-1(href=menu.XML target=frameno2)</title> <adres>menu.XML</adres> <target>frameno2</target> </altlink> <altlink> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link1-2</isim> <title>Link2-2 (href=menu.XML target=blank)</title> <adres>menu.XML</adres> <target>blank</target> </altlink> </link> </menu> </xmlmenu> menuyu oluşturmak için yapmanız gereken tek şey menu.XML dosyasını düzenlemek menu.XML örnek şablon Kod:
<?XML version="1.0" encoding="windows-1254"?> <xmlmenu> <menu> <link> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link1</isim> <altlink> <style></style> <color>#ffffff</color> <hovercolor>#cccccc</hovercolor> <bgcolor>#6699cc</bgcolor> <hoverbgcolor>#57a6d4</hoverbgcolor> <isim>Link1-1</isim> <title>menu.XML dosyasına gider</title> <adres>menu.XML</adres> <target></target> </altlink> </link> </menu> </xmlmenu> en sondaki </link> den sonra yeni bir <link> aradaki kodlar </link> eklemek Alt link oluşturmak için: en sonda ki </altlink> le </link> arasına <altlink> aradaki kodlar </altlink> eklemek İnce ayarlar: <style></style> tag ayarı bu bölümde menu nun font ve padding gibi benzeri style ayarları yapabilirsiniz örnek: <style>font-family:arial;font-size:15px;</style> <target></target> adres te belirtiğiniz link in nasıl açılacağı belirlenir boş bırakılırsa <target></target>: menu nun bulundugu sayfada link açılır blank yazılırsa <target>blank</target>: yeni bir pencere açar ve link orada açılır menuyu frameli veya iframeli bir sayfada kullanırsanız top yazılırsa <target>top</target>:frame iptal olup sayfa komple linkteki adrese gider frame veya iframe in Name i yazılırsa: <target>frameName</target> : link belirtilen frame veya iframede açılır Not: frame veya iframe name yanlış yazılırsa blank devreye girer. Mesaj biolight tarafından 14.09.2003 (22:08) yeniden düzenlendi.. |
|
|
|
|
|
#3 (permalink) |
|
Üyelik Tarihi: 06.06.2001
Yer: istanbul
Yaş: 31
Mesaj: 697
|
süper..hemen arşivime alıyorum bu bilgileri...
ara ara canımız çıkıyodu valla böyle bi menüyü ![]()
__________________
Kişisel: ozankilic.com | İşsel: Biletix.com | Fotosel: flickr.com/photos/okilic | Stocksel: istockphoto.com/ozankilic |
|
|
|
|
|
#4 (permalink) |
|
Üyelik Tarihi: 22.06.2001
Yer: Antalya
Yaş: 38
Mesaj: 531
|
Teşekkürler @Scud, @Firan Zal'honan
![]() biraz erken bir menu oldu gibi ie5,5+ dan dolayı XML ve xsl ASP ile tarayıcı bağımsızlığı sağlanıyor ama JavaScript te kullandığım window.createPopup(); tekniğinden dolayı tarayıcılara bağımlı kalıyor herneyse geleceğe yatırım olsun diye şimdiden yazayım dedim. |
|
|
|
|
|
#8 (permalink) |
|
Üyelik Tarihi: 22.06.2001
Yer: Antalya
Yaş: 38
Mesaj: 531
|
@Chashmir,
alt linkler alakasız bir yere çıkıyor derken bu alt linkler başka bir linkin altındamı çıkıyor yoksa menu ile alakası olmayan bir yerdemi çıkıyor. eğer menu.XML dosyasını yazabilir veya link verebilirsen daha yardımcı olabilirim. @Rå®, uygun tarayıcıyla bakıyorsan çalışması gerekirdi şuan bir daha test ettim (ie6) bende çalışıyor. belki menu.XML ve menu.xsl dosyalarında problem olmuş olabilir bu dosyaları tarayıcınla direk çalıştırıp kontrol edebilirmisin eğer hata varsa ie direk hatayı ve yerini gösterecektir. kolay gelsin. |
|
|
|
Zoque'a hoşgeldiniz!|
En popüler ilk 100 etiket
Tag Cloud
|
| acil adsl ajax almak arama araniyor ariyorum ariyoruz asp bilen bilgi bilgisayar blog calisma canon css dijital div domain dosya eleman film firefox flash font form forum fotograf freelance google gore grafik grafiker hakkinda hangi hata hatasi hosting html ilgili ilk |