how do i scroll page when i get to a location ...
something like :
<body onLoad="sl()">
<script languge="javascript">
function sl(){
if (document.stopper.y>50)
{
window.scroll(0,100);
}
</script>
then always when the user try to scroll to (0,100) its will be scroll
him to (0,50) or something like
how to make an image/text to scroll as the user scroll the page also? for example if the user scrolls down image/text also scrolls down and when the user scrolls up image/text also scrolls up..
I have an webbpage, and in the middle of it there is an iframe to a php site. So i have used this code, so after some seconds the iframe will send the guest to another page. <meta http-equiv="refresh" traget="_top" content="5 url=http://mypage.com"/> But the thing is that i want the WHOLE page to reload, and go to that page after 5 seconds (we can say). With that code, only the iframe are going to another page. Is it possible to make the whole page send the user after some seconds, to another page and not only the iframe?
Basically, I have a link that should open the targeted link in a blank page, and upon the link being clicked, the original page's URL should be changed. The reason for this is that the user has to browse information on another website, and then pass the information on to me via a contact form, so rather than make them click back on my tab in the browser, and then find the "Contact" page link to fill in the form, I thought it would a good feature to simply go ahead and load the "Contact" page upon them clicking the link to the external page (which of course loads in a new tab). Here is the code I have in place:
This all works fine on my computer, regardless of the browser that I use. One of my partners on this project called me this morning and said that the link was taking him directly to the "Contact" page without opening the "Other Site." This is strange because after I put this in place, I showed it to him and it worked fine. Now, a few days later, and it does not work. He said that he cleared his browser cache, history, cookies, etc. and the problem did not go away. He uses IE8. After he told me it was no longer working, I went to test it myself, and it works fine for me no matter which browser I use (IE8 or 9, Firefox 3 or 4 Beta).
why this might have worked one day and not the next? Is it simply a problem on his computer, or could it be an issue where based on what type of browser you are using, this won't work. Also, I know this is the JavaScript forum, but is there a way to do this in PHP without using the JavaScript onclick event? Obviously, I can't use the header() function since this functionality needs to be present on a link within text of a page.
I'm using a JQuery function to slide a div into and out of visibility, but every time I toggle, the browser resets my view to the top of the web page..What I want to happen is when you click to reveal the div, the page scrolls down and the div content is in full view. When I click again to re-hide the div, I want the page to scroll back up smoothly instead of just reverting to the top of the whole page...The page url is: http:[url]....Here's my code:
I want to create a table in javascript with a predefined height and width and put html code in its td.I wanna know when i should stop writing html code when my table have reached the predefined height.Is there any way to do that?I started by doing this :
var srcTable = document.createElement("table"); srcTable.border = 1; srcTable.borderColor = "Black";
The site I'm working on lists holiday accommodation (from a searchable database). The user can then 'short-list' several properties for further action (as yet unspecified). This is similar to having a list of products and adding them to a cart. Ajax is working fine to the point of adding the items to the Short-list, but because the page is no longer refreshing certain PHP variables aren't getting changed, so: (a) The 'Add to Shortlist' button isn't changing to 'Remove' and (b) The 'div' showing the Short-list controls isn't appearing
A non-Ajax version can be seen at: [URL]
This will show what should happen when an item is added to the Short-list, but the page refreshes and returns to the top. With Ajax nothing moves (which is the intention), although the addition to the Short-list does happen in the background, and everything displays as it should when the screen is (manually) refreshed.
I'm not sure how best to get the changes (a) & (b) above to happen with Ajax without losing the non-Ajax capability provided by the PHP. I have wondered about setting the button image with CSS and then changing the class using Ajax, but haven't tried it yet. It must happen only on the clicked button, of course.
I want to use JavaScript to detect the number of times a key (for example, the A key) is pressed. Once it reaches a preset number (say 10 for this example), it will trigger two events:
1. Change the background color of a cell in a table from white to black.
2. A split-second (e.g., .01 second) later, submit the form on this page.I can't have the user hit the ENTER key to submit the form, so the JavaScript script will need to do this.
In my MVC 2 website i have an index page with a list of items. Besides each item is a delete link which once you press it prompts you with a jQuery dialogbox where they need to confirm their action.I get the dialog box op with the right buttons and text. But the issue occurs when I try to confirm and call the deleteJob(jobId) method.The problem is that I never reach the ActionResult method in my controller.
I am just beginning to try to learn some js, and am making a site which requires a multi selection form with each being added up to reach a total. This sounds like a standard form, but this is a little different. I have files in megabyte sizes, from which people would choose what they wanted, and the total deciding how many dvds would be needed to store that many files...and this total could then be added to a js shopping cart. By the way, there is nothing illegal or pirated with the files in case you have any concerns.
I need to be able to display dynamic HTML inside a DIV (can't tell what the html nodes would be) - i.e needs to be flexible. The HTML that goes inside the DIV would have its own Javascript too. I was able to get this code snippet working on Microsoft IE7+, was wondering why the same won't work on firefox.
HTML Code: <html> <head> <script> /* the input type = hidden is necessary or the JS won't be accessible */ /* script defer tag is also necessary */ function insertHTMLOnButtonPress() { var s = "<html><input type='hidden' id='dummyHidden'/><head><script defer='defer'>function dynamicallyInsertedFunction() { alert('Successfully called - dynamicallyInsertedFunction'); } </sc" + "ript></head><body><input type='text' value='Hello World'/><input type='button' onClick='dynamicallyInsertedFunction();' value='Call Dynamically Inserted Method'/></body></html>"; /* Clearing out innerHTML is also required to flush the innerHTML so that repeated attempts - i.e new HTML/JS should work */ document.getElementById('wholeBody').innerHTML = ''; document.getElementById('wholeBody').innerHTML = s; } </script> </head> <body> <br/> <!-- Don't close the div inline, causes some problem and replaces the buttons too --> <div id="wholeBody"></div> <br/> <input type="button" onClick="insertHTMLOnButtonPress();" value="Insert some dynamic html"/> <input type="button" onClick="dynamicallyInsertedFunction();" value="Call Dynamically Inserted Method"/> </body> </html>
I have tried a couple of things likeRemove the script defer tag - Removing the dummy input element added which is required for Desktop IE - Removing the empty innerHTML step before replacing it But none of these appear to work for Mozilla firefox. I am also looking for a similar behavior on Android's default webbrowser (WebView to be more specific) -- Doesn't work there too.
need some javascript that when a page is refreshed, the page will appear in the browser in a certain location down the page. Trouble is a php text link is being clicked on which causes the page refresh. Anyone know a way to show a page location after a page refresh with javascript?
I have been a happy lurker for some time now, soaking in the abundant knowledge that i have found here. But now I am at my wits end trying to find the solution to what is probably a novice’s oversight.I have a menu that animated with jquery. One of the link I have added js call a function that asks for a quick password then opens new page. Some reason it only seems to refresh the page. Here's the code involved.the js
function password(){ var password; var pass1="cool";
scroll may page to top like the one used on this page - http://www.pngised.net/ In the footer theres a link entitled 'bring me to the top' when selected scrolls the user to the top of the page, Iv been trying to find this technique but havent been successful.
point me in the direction of were I could get the code to scroll may page to top like the one used on this page - http:[url].....In the footer theres a link entitled 'bring me to the top' when selected scrolls the user to the top of the page, Iv been trying to find this technique but havent been successful.
I have a site with dynamic pages, where content is fetched via a hidden iframe client/server. I'd like to be able to allow people to bookmark the 'state' of the page, by generating a URL depending on current content. That URL would ideally be visible on the location field of the browser, and bookmarkable.
I'm new to this forum and JS. I simply want to be able to use the Google Maps API v3 to allow a location value entered in my app (by the user) to show that location via Google maps.The code below accomplishes this via an onClick event. How to accomplish the same WITHOUT an onClick? To be clear, it appears I need to be able to perform the geocode lookup to get the long/lat coordinates and then apply them. That all needs to occur on page load.
every time i try something it doesn't work for me :( god why is this javascript so hard to make it work... anyway, i just followed the guidelines to pass values from one page to another using ? and it simply, like always, DOES NOT work .
The encoded html part is simply a link [URL] The code works fine so far on all browsers. But the problem is that it redirects wrongly.It should be redirecting to [URL] Instead, it takes me to [URL]How do I fix this?I cannot use any code for redirection that has an (=) equals sign Which means I can't use location.href='http://google.com'
I am trying to make a floating "drag-able" navigation box that will seem not to reload between pages. I hope this make sense
The navigation is in a floating box that can be dragged as well as collapsed. And when you go from page to page the box will remain in the same location and in the same state (open or collapsed) ultimately creating the illusion that the nav box doesn't reload. Can this be done with JS? If so is the way to maintain the location with cookies or is there another way?