PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
t_henson
Regular
Regular


Joined: Feb 02, 2007
Posts: 60
Location: Cincinnati, Ohio

PostPosted: Sat May 19, 2007 12:06 pm Reply with quote Back to top

i am looking for a way to have a drop down menu when you rollover an image. i have found ways to do it with just text links, but not with an image. any help with pointing me in the right direction?
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7236
Location: Arizona

PostPosted: Sun May 20, 2007 6:44 am Reply with quote Back to top

Actually, the two should be quite similar. Instead of using the "onclick()" event, you would use "onmouseover()" to show the menu and then "onmouseout()" to then hide the menu.
View user's profile Send private message Visit poster's website
t_henson
Regular
Regular


Joined: Feb 02, 2007
Posts: 60
Location: Cincinnati, Ohio

PostPosted: Sun May 20, 2007 3:08 pm Reply with quote Back to top

okay, well i guess you cant used css style or javascript in header.html?
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7236
Location: Arizona

PostPosted: Sun May 20, 2007 5:19 pm Reply with quote Back to top

t_henson, actually, use external files and then add the links to them in includes/javascript.php. Then you can call the functions / etc. from your main content / blocks / header / whatever just fine.
View user's profile Send private message Visit poster's website
t_henson
Regular
Regular


Joined: Feb 02, 2007
Posts: 60
Location: Cincinnati, Ohio

PostPosted: Sun May 20, 2007 7:10 pm Reply with quote Back to top

okay i added the css style and the javascript functions to javascript.php and then added the onmouseover() info in the header.html file but i cant get it to work.
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7236
Location: Arizona

PostPosted: Mon May 21, 2007 6:01 am Reply with quote Back to top

Please post your header.html file here if you don't mind (unless it is riddled with javascript). Otherwise send it and your .CSS and .JS files to me at montegoATmontegoscriptsDOTcom and I'll take a look.
View user's profile Send private message Visit poster's website
t_henson
Regular
Regular


Joined: Feb 02, 2007
Posts: 60
Location: Cincinnati, Ohio

PostPosted: Mon May 21, 2007 10:22 am Reply with quote Back to top

thanks. i sent you an email.
View user's profile Send private message
djmaze
Subject Matter Expert


Joined: May 15, 2004
Posts: 538
Location: http://tinyurl.com/2rxdv3

PostPosted: Mon May 21, 2007 5:00 pm Reply with quote Back to top

only A supports the :hover pseudo.
Therefore use <a><img></a>
View user's profile Send private message Visit poster's website
candy
Worker
Worker


Joined: Dec 21, 2004
Posts: 223
Location: Kansas City metro

PostPosted: Tue May 20, 2008 9:05 pm Reply with quote Back to top

hi i am trying to use javascript functions in my nuke header as well but with no luck. Can you please help? Thank you.
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7236
Location: Arizona

PostPosted: Wed May 21, 2008 5:27 am Reply with quote Back to top

candy, a link to your site which has the changes you have made would be helpful. Also, having some idea of what you are trying to add... thanks.
View user's profile Send private message Visit poster's website
candy
Worker
Worker


Joined: Dec 21, 2004
Posts: 223
Location: Kansas City metro

PostPosted: Wed May 21, 2008 1:59 pm Reply with quote Back to top

thanks...i haven't actually made the changes because if i overwrite my current header it will be screwy. so i am waiting to fix the header before overwriting my current one. i basically took my header and am adding a row that has a drop down menu in javascript but when i go to test it on the site, the script doesn't work because the drop down isn't shown. any ideas on why this isn't working? thx!!!
View user's profile Send private message
candy
Worker
Worker


Joined: Dec 21, 2004
Posts: 223
Location: Kansas City metro

PostPosted: Thu May 22, 2008 3:42 pm Reply with quote Back to top

here's the script i have in my header.html file but when i go to upload it the drop down menu doesn't work or show. any ideas on what i might be leaving out or doing wrong? Thank you!!!

Code:
"<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- © 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="/modules.php?name=Forums">Forums</a>'
menu1[1]='<a href="/modules.php?name=Your_Account">My Account</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="/modules.php?name=marketplace">Marketplace</a>'
menu2[1]='<a href="/modules.php?name=Downloads">Coupons</a>'
menu2[2]='<a href="/modules.php?name=News&file=article&sid=5">Kids Eat Free</a>'



//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="/modules.php?name=Forums">Message Boards</a>'
menu3[1]='<a href="/modules.php?name=TotalCalendar">Event Calendar</a>'
menu3[2]='<a href="/modules.php?name=Chat">Chat</a>'
menu3[3]='<a href="/modules.php?name=coppermine">Photos</a>'
menu3[4]='<a href="/modules.php?name=Journal">Member Blogs</a>'
menu3[5]='<a href="/modules.php?name=Your_Account">My Account</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?

/////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>
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7236
Location: Arizona

PostPosted: Thu May 22, 2008 5:00 pm Reply with quote Back to top

Maybe you can PM me a link to your site as I really want to see the end result when the HTML is generated. Wink
View user's profile Send private message Visit poster's website
candy
Worker
Worker


Joined: Dec 21, 2004
Posts: 223
Location: Kansas City metro

PostPosted: Thu May 22, 2008 6:22 pm Reply with quote Back to top

i dont' have the header on my site because it is faulty. i have it on my site as /header3.html instead of header.html and by itself it shows up. only when i plug it into the header.html file does it not work. in other words, i don't have it as part of my site now because the drop down doesn't work. i was hoping to troubleshoot and resolve it before i upload it as my new /header.html file. thankx!
View user's profile Send private message
candy
Worker
Worker


Joined: Dec 21, 2004
Posts: 223
Location: Kansas City metro

PostPosted: Mon May 26, 2008 10:18 pm Reply with quote Back to top

any ideas on how i can get this jscript header to work for the drop down menu? thanks!
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7236
Location: Arizona

PostPosted: Tue May 27, 2008 6:18 am Reply with quote Back to top

candy, its on my list, but I have things ahead of it. Once you said that I cannot see the generated HTML, it makes my job that much more difficult and takes time that I have very little of. I'll get to it. Sorry that I cannot give you a date as to when... Sad
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum