I'll let out my secrets :)

But of course, that's what donating is good for, & the money goes to 
hosting costs.

I don't know about tutorials on this, but here's what I did

<div id="menu">
    <div class="item">item 1</div>
    <div class="item">item 2</div>
</div>

The items have mouseover, mouseout and onclick events. Thinking about it 
now, I should make them <a> tags with display:block; styles and :hover 
selectors. Maybe in the next version. The #menu is display:none;.

My <body> tag has an onClick event to clear open context menus (hide 
divs) and has OnContextMenu="return false;".

When you right-click on an icon, it calls onContextMenu to my handler 
function. You tell it what menu you want (directory, file, etc.) and 
what you right-clicked on (file name). This function sets a variable for 
the filename (in case you do something with it), hides the other context 
menus, does a little math to tell the position you want it at (below), 
and sets the css display to visible.

Here's the positioning js:

if (locationLR == 'left') {
    window[menuName].style.right = null;
    window[menuName].style.left = window.event.clientX + 
document.body.scrollLeft;
} else {
    window[menuName].style.left = null;
    window[menuName].style.right = Math.abs(window.event.clientX - 
document.body.offsetWidth) - 20;
                        }
window[menuName].style.top = window.event.clientY + document.body.scrollTop;
window[menuName].style.visibility = 'visible';

I've included that because it was probably the hardest part to figure out.

When you click an event in the menu, the onClicks all go through a 
goTo() function. You tell it the action 
(filesurfer.cfm?action=#action#), and it passes the file name variable 
along with the link. Here's the location.href for a good visualization:

window.location.href = myself + '?action=' + action + '&filename=' + 
jsDir + rightClick_fileName + LocationExtra;

So, that's pretty much all of it. No more secrets. Good luck with your 
project.

-nathan strutz
http://www.dopefly.com/






Spectrum Web wrote:
> Thanx Barney and Nathan. 
> 
> Nathan great job man. Looks(and works) great. Very cool! Your context menu is 
> nice. How to do that? Sorry but your filesurfer-freeware is encrypted. You 
> could give us more details? Maybe off-list.
> 
> Thanx once more...
> 
> Marco
> 
> 
> 
>>http://www.dopefly.com/projects/filesurfer.cfm
>>
>>Special right-click works on IE (just haven't X-browser'd it).
>>
>>-nathan
>>
>>
>>Marco Antonio C. Santos wrote:
>>
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183620
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to