JQuery :: Using $(window).scroll To Call A Function
Feb 13, 2011
I need to have a function run only once when the user scrolls. My problem is that I can't seem to figure out how to get .scroll to only check for that first scroll. I have come up with a working solution using a count, but I am hoping there is a better way to do it. I assume that it checking for a scroll constantly is just a waste of resources. My solution doesn't fix that problem, it only makes sure the function runs once.
I have created and opened a child window called "checkwin" and have written some data to it. If the data is valid, I want the user to click on the 'CONFIRM' button on the child window, at which time I want the "submit()" function for the form on the parent window to be executed. If the data is invalid the user clicks on 'MODIFY' and I want focus to return to a field on the parent form. However, when I click on the "CONFIRM" or "MODIFY" buttons on the child window, nothing happens. Here is the code:
Ok so I have a site that I want to automatically close the window when the focus is lost from the page. For example, if the user clicks off the page to something else on there desktop I want the page to close. So far I have managed to do this but the grids on my page and the scroll bars all trigger the close function when clicked on. Is there anyway to make the scroll bars and drop down boxes not trigger the function?
I have a function reloaddash(1); for refresh the db.js in db.js file which sends a ajax request to the action file. In this .js itself I draw the table,td,tr for display. I dont use seperate .jsp file to draw. By onclick a link in this js file I opened a new window using window.open(URL). Now my confusion is If I close this new window I need to refresh this .js file that is i need to call the function reloaddash(1); But I dont know how to call this function on the closing of new window. Is there any option to call a function from w.indow.close or parent.opener.
I have a small window that I can call from my top menu that opens a 'radio station' to play music clips from, my site. If the user goes to a page with video/audio players on it and opens one of these tracks, I need to send a 'STOP' command to the radio window. I think the pseudo-code would look like:
Code:
if (window.open 'DashRadio') javascript:player.sendEvent('STOP'); endif
But I cannot get the code to address the 'DashRadio' window.I open it from my top menu like so:
You can see it in action at The Soundsmith, the actual radio window is this one. I would have thought this was stupid simple, but I can't get a handle to the Radio window. OTOH, I am very much a newbie in javascript, I spend a few years in FoxPro and other 3GL languages, but C-style code throws me.
When using this script on a external js, it will not run. Trying to learn js and I do not understand why it does not work, when it should. The window.onload should call the function.
I am using a timer to fadeOut and fadeIn some articles such that 5 articles are displayed in rotation.However, for some reason the call to fadeIn or fadeOut is causing the page to change it's y scroll position. If I am currently at the bottom of the page, the fadeIn call causes the page to scroll up.
<button onClick="return popup('<span onClick='selectShape(1, 1, 1)'>test<span>');" tabindex=Ɖ' onFocus="setFocusColor(0,3)">....</button> This will work perfectly, but as soon as I need to pass Strings inside the selectShape function, I get stuck.
So the question is, how can I create the following and have it working
I'm wanting a table cell click event to remove and replace the table it was clicked on, however I'm finding that as it's deleting the original table object the actual running event code is being replaced and the function is bailing.how I can call the delete/refresh function from outside the event's function scope?
I have just started learning JQuery and have a doubt in the below code. $.get('myhtmlpage.html', myCallBack);The doubt is should the 1st parameter of the get function be a HTML file or can it be a unction name?
I have a real perplexing issue. In two separate "projects" I had code that displayed checkboxes - when clicked, they would fetch information from a db and display it in the div below. I had code that displayed a jquery date-picker - when clicked, it would fetch information from a db and display it in the div below. My issue comes with this:
In my main window, I create a popup window. Is there a way to bring the main window back to the foreground (make the main window the focus window again) from the popup window using JS? Like from a link or a button?
When I use the following code snippet in all major browsers (Chrome, FF, Safari, Opera, IE8), the window opens with a scroll bar and it is resizeable EXCEPT IN IE8. In IE8, there's no vertical scroll bar and it's not resizeable... any idea why not?window.open('http://www.mysite.shtml?' + report_vars, '', "status=no, toolbar=no, location=yes, menubar=no, scrollbars=yes, alwaysRaised=yes, resizable=yes, width=" + window.outerWidth / 1.1 + ", height=" + window.outerHeight-0.1);
The following script will take the option parameter from the page URL and scroll the page to the element which has the matching ID.For example:mypage.html?element3will cause it to scroll to the element which has an id="element3" when the page loads.
<html><head><title></title> <script type="text/javascript"> function OptionScroll(){
using window.open to open a popup, the "scrollbars=1" thing is not working in IE8 for some reason (the window opens, its just that the scroll bar that isn't showing).
I'm creating a full-screen window in javascript. I"m not interested in debating whether or not a full-screen window is good or not, or any of the other philosophical diarrhea, I just need an answer to getting rid of the scroll bar... Trust me, in this case it NEEDS to be full-screen and it SHOULD NOT have any scrollbars. This is being done on a PC running Windows 7, 64-bit, IE 8, and EVERYTHING is up-to-date. The window gets created fine, but there's an empty scroll bar on the right side. ALL I want to know is how to get rid of the scroll bar so this works AS STATED IN THE DOCUMENTATION......