I want to run my own event handling javascript code on a site. Such as:
$(".dropdown li").on('mouseenter mouseleave', function (e) {
var elm = $('ul:first', this);
var off = elm .offset();
var l = off.left;
var w = elm.width();
var docH = $(".container").height();
var docW = $(".container").width();
var isEntirelyVisible = (l+ w <= docW);
if ( ! isEntirelyVisible ) {
$(this).addClass('edge');
} else {
$(this).removeClass('edge');
}
});
Is there any way to do that using firebug or element inspector?
You can just write your code in an editor, copy it to the clipboard and paste it in the debug console in any browser's debugger. The console will execute the code and it will be active in that page until you reload the page.