Remembering Position

Aug 20, 2007

I have found the code to move my objects around but I can't find a way of remembering the positions the objects were left at when I refresh the screen.

I would like my users to be able to move the layout around and have it save their layout so that the next time they view the website its as they left it.

View 2 Replies


ADVERTISEMENT

Onmouseover Vs Css Hover (remembering Last Position)?

Mar 14, 2011

So I have this vertical menu with a few options. Originally it was pure CSS with a basic a:hover to change the background of the menu item. But then it was decided that whichever menu item you last had your mouse on should remain in that hover state.

So I went ahead an busted out some Javascript. Now I'm not exactly talented with Javascript as it's not one of my main languages. This is what I came up with.

[Code]...

View 2 Replies View Related

JQuery :: Inelegant Code For Remembering Position Of Panel?

Jul 30, 2009

I know someone will enjoy rewritting this chunk of code for me and the community! It's a simply cookie to remember the position of an animated panel so it stays open (or closed) after a page reload. It is working*, but I am sure it can be shorte*Actually it's not perfect, when you close the panel you lose the button altogether until another page refresh! Long code that doesn't work!

$(document).ready(function(){
$("#AdvancedSearchButton").click(function(){
$("#SearchResultsHeaderContainer").slideDown();

[code]....

View 1 Replies View Related

Remembering Last Position In Textbox / Textarea And Returning To After Post / Reload

Jul 20, 2005

I've got this javascript routine (i found on google) in an
asp.net page that on page reload sets the cursor of a textbox to the
last line. It works great!

Using a similar concept, I have another application that uses a
textbox like an editor window and has a save and other buttons.
Problem is - when I save/post/reload, the textbox returns to cursor
the top again.

How can I preserve / save the exact cursor spot and return to the
exact same spot I was in before I saved. Code:

View 3 Replies View Related

Geolocation - Automatically Load Position As Position A Then Choose Position B From A Dropdownlist

Nov 23, 2011

i,m trying to make a map who show me as position A and a target adress as point B.I have made it so i can choose adress a and adress b from a dropdown but i want to automaticly load my position as possition A then choose position B from a dropdownlist. How can i do this ?

[Code]....

View 2 Replies View Related

Remembering If A Div Is Open Or Closed?

Jul 5, 2009

The first thing I'd like to do is show/hide divs. What I'm going to do is pull out a few bits of PHP code out of the database and assign them all a class of show or hide. So, I need a script that can either open or close a div using a link using classes, probably with AJAX or DOM? The main thing is that it needs to be compatible with all major browsers. I've scoured the internet but can't find the most simple of scripts, and unfortunately my AJAX/DOM is terrible!

The second thing I need to do is remember which divs are open or closed. I was thinking of doing this with a database, and so I'll need to run a tiny PHP script to update the DB whenever a div is opened or closed. I assume this would be done using an onclick event? If so, I probably need to use GET to update the new class in the DB. Any ideas how I'd work out whether the div was open or not, and what function I'd use to run the PHP script?

Also, every time a page is loaded I'll get the 'show' or 'hide' options from the DB and assign them to the classes so the user still has their preferred tabs open.

View 14 Replies View Related

Remembering The Random Links?

Sep 6, 2010

I now have the following script to generate a randomised listening test for students (I've removed some of the more elaborate features for the purpose of this thread).

Code:

<html>
<head>
</style>

[code]....

One thing that I have just now noticed (dunno how I missed it before) is that clicking on the link generates a new random link each time it is clicked. What I would really like is for people to be able to hear the same sound as many times as they want until e.g. they hit the browser refresh button.

View 4 Replies View Related

Remembering Object Properties And Methods

Jan 17, 2011

Do many programmers remember most of the object properties and methods or do they use IDE or references to find those specific objects. I'm starting to learn Javascript and seeing all the different type of objects available can be depressing. :(

View 2 Replies View Related

Remembering Opened Windows After Refresh?

Oct 27, 2004

I have opened a window in javascript with:

mywin = window.open(blahblah);

To keep myself from reopening the window everytime i do a click, i changed it to this:

if(typeof(mywin)=='undefined' || (more conditions here))
{
mywin = window.open(blahblah);
}

The problem is: variable "mywin" is lost after i REFRESH the current page. Since i'm doing a LONG, LONG inventory management (where the opened window is about 200K long), I want to know how I can access the opened window. I tried searching the web, but as far as I know there isn't any "list of windows previously opened by this one" method or property.

I've managed to do it with a setTimeout function on the child window that calls another function of the parent window every 1/2 a second. Code:

View 2 Replies View Related

Collapsible Menus: Remembering Place

Dec 21, 2005

The script below allows me to create expandable/collapsible menus. What I'm trying to figure out, and have been brutally unsuccessful thus far, is how to expand the menus upon an initial visit.

For example, on the home page, I have a link to "Colors" and a link to "Groceries". When a user clicks on "Colors, they are taken to a page with the collapsible menus:
Colors
GroceriesIf they were to click on Colors, the menu would expand and the user would see:
Colors
- Red
- Blue
- Yellow

GroceriesI want to make it so that if the user clicks on "Colors" from the home page, the "Colors" menu is automatically expanded on the page with the collapsible menus.

Can someone help me out? Code:

View 8 Replies View Related

Cookie Remembering Drop Down Box Styling?

Jun 20, 2009

Haven't used cookies before really but I'd like to create a cookie that remembers the options a user has selected so they can have their styling next time they visit. The user selects the styles through 2 drop down boxes. Below are the drop down boxes for the information I would like the cookie to remember.

HTML Code:
<script type="text/javascript">
function fontsize() {
selectedstyle = document.form1.font.selectedIndex;
newsize = document.form1.font.options[selectedstyle].value;

[Code]...

View 2 Replies View Related

Resolved With Google Chrome (position:fixed Horizontal Position:absolute Vert?

May 13, 2010

I'm new to javascript and am not sure why this works in firefox and not chrome. I am trying to create a script that keeps an object fixed horizontally while bing positioned absolute vertically. if I replace the toPP variable in document.getElementById('fire').style.top = toPP; with say '50px' it will move the element down 50 pxs, but how I have it currently it doesn't do anything in chrome

<script type="text/javascript" >
window.onscroll = function()
{
if( window.XMLHttpRequest ) {
var x = 0 -document.documentElement.scrollTop;
var toP = String(x);
var toPP = toP + "px";

[Code]...

View 7 Replies View Related

JQuery :: Form Fields - Keep The Form From Remembering Past Input?

Jun 17, 2011

I have a form that has a reset button, and when it's closed, the form is reset. However, at least in testing on my own machine, I notice that the form fields are remembering past input (on Firefox 4 anyway). Once this goes public, I don't want the form remembering anything in case the website is viewed on a public machine. How can I keep the form fields from remembering any past input?

View 2 Replies View Related

JQuery :: Set Background Position To Position Of Parent

Aug 11, 2009

#navigation li is the parent element, which is positioned relative.The ul element above that is also position relative. I previously tested a click function and was able to confirm I was getting the correct position back, so now I just need to set the CSS property correctly for all of those links.The reason I want to do this is I have a set of links that appear over a photo of a city skyline. When you hover over those items, I want them to be given a background image that is a blurred and lightened version of the same photo so it needs to line up (sort of like the tabs are made of frosted glass).

View 1 Replies View Related

JQuery :: Rounded_Corners - DIV Position - Properly Position The Whole DIV Of Class "roundbox" ?

Feb 18, 2010

I have found nice short tutorial here: Rounded_Corners

It works fine unless I try to move it.

I have added only one DIV over all:

Now I see that my text (white) moved but not background.

How do I properly position the whole DIV of class "roundbox" ?

View 1 Replies View Related

Position Of A Tag With Position Not Assigned

Jul 31, 2005

I have a HTML file that has a lot of content. In it I have a <div id="d1">somecontent</div> block. Would it be possible for me to know the position of this d1 (absolute or relative) displayed on the page / window if not setting it first ?

View 5 Replies View Related

How To Get Tag Position

Mar 22, 2007

I have a <img> tag in my web page that i use as button.
when user will click on it, i would like to display a hidden <div> just under.

I mean by just under, that next pixel below the <img> should be the top of <div>.
Moreover, the left of <img> should be the left of <div>... like that it will look like aligned.

The challenge is the following one.

my <img> is positioned by CSS file, so it can (but it is not a must) have left and top setup... maybe not.

I did a short test :
if i setup in CSS file the left and top of <img>, a simple click on <img> can not retrieve the left and top of itself.

something like that i did :
function ShowCalendar(id_master)
{
var uleft = document.getElementById(id_master.id).left;
alert("Left : " + uleft);
}

where id_master = id of the <img> as following :
<img id='id_img' class='buttonimg' src='calendar2.gif' ></img>

So how can i solved this issue ?
Moreover, position of this <div> should be in absolute coordinates, to avoid issue in browser Xsing.

View 1 Replies View Related

Scroll Position

Jul 23, 2005

Hey peeps, I'm trying to get a webpage open and start scrolled fully to the bottom. How should I go about this?

View 3 Replies View Related

Determining Position

Sep 9, 2006

I have some floating divs on my page.

When I click the div I want do display a menu over it, how can I
determine the position of the clicked div on the page?

View 6 Replies View Related

Getting The Position Of An Object

Jul 20, 2005

I have simple table
<table id = "mytable" ....>
....
</table>

I want to get the left position of the table.

Everything I did getting wrong :

mytable.left doesn't work, neither mytable.style.left,
mytable.getAttribute("left") ...

What is the correct syntax for getting the position of the table element
(and others ...) ?

View 3 Replies View Related

Display And Position Div Next To Td In Js

Apr 3, 2009

I am an html/css/php professional who dabbles a bit in javascript and many other languages. I must say up front however that I absolutely despise javascript. However, it is necessary for the work I do, so I get by. I have been working for roughly 5 hours trying to find a solution to this. What I do doesntwork, even though I believe it should. Here is my problem: I have a 'menu', based inside of a table. There is one particular td, that when clicked, displays a menu of the users online friends. The friends box is in a div.

The td is name 'online' and the friends box is named 'menufriends'. (with id's, of course.) My problem is that I need the friends box to display next to the td. So what when you click the td, it shows up to the right of it instead of below the menu. I have tried all sorts of different methods and cant even get it to change its position.

[Code]...

View 25 Replies View Related

Get The Absolute Position Of A DIV?

Jun 28, 2009

Before you immediately give me an answer, let me describe fully what I'm trying to do, as it's not as simple as the title suggests.

I need to get the absolute position of a DIV (top and left properties) relative to the viewport/screen.

I've tried using .offsetTop and .offsetLeft, but these return the top and left properties relative to the DIV's immediate parent element, not the viewport (unless of course the DIV is top-level and not contained in any other DIVs).

So, is there any way to retrieve the absolute position of a DIV relative to the viewport, even if that DIV is nested in other DIVs?

View 1 Replies View Related

How To Position The Scrollbar

Nov 6, 2009

Is there some possibility to put the horizontal scroll bar of the web browser into the center if the "width" of web page are bigger then the "width" of the web browser screen?

So I don't need to scroll to right if I open the page, but the horizontal scroll bar will be positioned in the center.

That code should do the same think like I when I take the scroll bar and put it in the center position, but this should be happen when I load the page automatically.

View 3 Replies View Related

Div Not Displaying In Right Position?

Mar 3, 2010

i want the div to be displayed where the mouse was clicked... whats wrong?

<head>
<style type="text/css">
#layer1 {
position:fixed;

[Code]....

View 1 Replies View Related

Move Div Img's Y-position

Nov 6, 2011

I'm using a javascript function to toggle and display only 1 div at a time. In this case, I have 3 divs as toggle buttons and 3 divs to show content (which belong to those 3 buttons). My problem is these 3 divs (divs with class .linkBox) that act as buttons are using the same background-image and I would like to have it move up (y-position: -48px to be exact) when its content is displayed.

[Code]...

View 1 Replies View Related

Best Way To Position Absolute Div?

Jan 18, 2009

Its said that placing the absolute div within a relative div is a best option to correctly achieve the margins within that relative div. However, I'm changing the marginTop and marginLeft via javascript and after some of the changes it shows the absolute divs in incorrect positions in IE.

What i want to do is calculate the vertical-middle right-sided position of text fields in x, y meaning in top and left margins. How can I do that?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved