vRoxaneCaldwellu
New Member
I have a CSS class defined called tinybutton -\[code\].tinybutton { border: none; }\[/code\]Really basic.In my application I make use of this class in my JSP pages many many times. Here is an example of one such a usage.\[code\]<input class="tinybutton" type="image" border="0" title="Search " alt="Search " valign="middle" src="http://stackoverflow.com/questions/14075358/<path>" name="methodToCall.performLookup.<parameters>.anchor" tabindex="1000000"></input>\[/code\]Essentially, the user is clicking on this button (an image of a tiny "Magnifying Glass") and they are taken to another page where they can perform some lookup after typing in some parameters. They can then click on a link that will return that value to the previous screen where they clicked on the image.Anyhow -I'm attempting to save the scroll location before the user is whisked away to another screen (which opens on the same page). The problem is that my SaveScrollMethod isn't getting called when I click on this button, so when I return to my original screen, my coordinates are not being restored to proper location.Incidentally, my SaveScrollMethod is attached to an EventListner on the page like so -\[code\]//Microsoft Internet Explorer Browser - iFrame event registerif (navigator.appName.indexOf("Microsoft") != -1) { var frame = getPortlet(); frame.contentWindow.location.replace('${channelUrl}'); var save = saveScrollPosition(); var prevPortletLoadEvent = frame.onload ? frame.onload : function () {}; var refresh = function() { prevPortletLoadEvent(); resizePortletContainer(); restoreScrollPosition(); }; frame.addEventListener('load', refresh, false); frame.addEventListener('keypress', save, false); frame.addEventListener('click', save, false);}//All other major browsers - iFrame event registerelse { var frame = getPortlet(); var prevPortletLoadEvent = frame.onload ? frame.onload : function () {}; frame.onload = function () {prevPortletLoadEvent(); resizePortletContainer(); }; var prevPortletResizeEvent = frame.onresize ? frame.onresize : function () {}; var onresize = function () {prevPortletResizeEvent(); resizePortletContainer(); }; if(frame.attachEvent) frame.attachEvent('onkeypress', save); if(frame.attachEvent) frame.attachEvent('onclick', save);}\[/code\]I was wondering if there was any way that I can setup an eventListener to listen to just onclick events for this particular image class and execute my SaveScrollMethod FIRST, and then let the image button do its thing, etc...Or is there a better way of doing this? Perhaps through CSS?