chaseman Posted May 5, 2011 Share Posted May 5, 2011 I've set up a test page trying to move the triangle shortly above the menu bar, but unfortunately when I adjust the top attribute to a negative number of the background-position then the arrow simply gets cut off, because of the division. Here's the test page: http://www.webprofitideas.com/css_testing/ I want to have the triangle right above the SUB-MENU (the blue line) when somebody hovers over the menu items of my blog on http://www.webprofitideas.com, I use the jQuery plugin Superfish for the navigation bar. I'm not even sure if my approach is the right way do to so, by simply using the triangle as a background, maybe there's a better approach. I'd appreciate some suggestions. Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/ Share on other sites More sharing options...
prestonwinfrey Posted May 5, 2011 Share Posted May 5, 2011 position: relative; top: -9px; Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211016 Share on other sites More sharing options...
chaseman Posted May 5, 2011 Author Share Posted May 5, 2011 How is that supposed to work? Top only works with position:absolute AFAIK. Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211034 Share on other sites More sharing options...
prestonwinfrey Posted May 5, 2011 Share Posted May 5, 2011 It works with relative positioning as well. Here is an example: http://jsfiddle.net/YYZw5/ Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211037 Share on other sites More sharing options...
chaseman Posted May 5, 2011 Author Share Posted May 5, 2011 It indeed works, I stand corrected. So I think if I assign a div into the SUB-MENU with jQuery for example (meaning without touching the source code or superfish) I may be able to achieve the same thing that you showcased on your link. Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211048 Share on other sites More sharing options...
chaseman Posted May 5, 2011 Author Share Posted May 5, 2011 Thanks for your suggestion btw, I got it to work on the test page: http://www.webprofitideas.com/css_testing/ And I "technically" got it work on my blog with Superfish as well, the only problem I have is that arrow is not showing up at all. You can have a look it here, if you simply hover over CONTACT http://www.webprofitideas.com I made the background red on purpose so it's visible where the arrow SHOULD be, I can not figure out why the superfish_arrow.png is not showing up at all, any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211059 Share on other sites More sharing options...
prestonwinfrey Posted May 5, 2011 Share Posted May 5, 2011 The arrow shows up for me in the link you provided. (Google Chrome 11) Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211063 Share on other sites More sharing options...
chaseman Posted May 5, 2011 Author Share Posted May 5, 2011 I don't know when you looked, maybe you looked when I uploaded the new version. But anyway I got it to work now. It's placed in the exact position I wanted it to be placed. The only problem I have now is that it shows up a tad bit too late, it's animated together with the sub-menu. Not sure how exactly to fix that, but I'll tackle that problem sometime later, I just have too much else to do now. Thanks again for your help. EDIT: The arrow didn't show up because I had the path wrong, jQuery path seems to work differently, I thought if I add it to the JS folder and simply directly call it would work, but it doesn't strangely I had to put it in the wordpress folder (outside of the theme). I will define a better path later once I've figured out how jQuery paths work. Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211065 Share on other sites More sharing options...
prestonwinfrey Posted May 5, 2011 Share Posted May 5, 2011 You're welcome! Quote Link to comment https://forums.phpfreaks.com/topic/235606-put-triangle-above-menu-line/#findComment-1211066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.