473,793 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DIV display state changes

I have been developing an image gallery which needed to be dynamic as
possible.

so I have placed the gallery in a div plus a div containing the large
image to be displayed. It works by changing the display property of the
gallery div to 'none' and the largeImage div to 'block' which has an
affect of switching pages but obviously saving time developing a single
page for each large Image, but (cliche') when I refresh the page with
the large Image div displaying 'block' it reverts the gallery and
largeImage display's back to their default states.

how can i prevent these states from reverting back to their default
states?

Here is the code example:
script language="javas cript" type="text/javascript">
<!--
function displayImage(im gSrc){
document.getEle mentById('theGa llery').style.d isplay = 'none';
document.getEle mentById('image Container').sty le.display = 'block';
var image = document.getEle mentById('large Image');
image.src = imgSrc;
}

function displayGallery( ){
document.getEle mentById('theGa llery').style.d isplay = 'block';
document.getEle mentById('image Container').sty le.display = 'none';
}
//-->
</script>

</head>

<body topmargin="0" leftmargin="0" marginheight="0 " marginwidth="0" >

<div id="imageContai ner" style="display: none; position:relati ve;
top:10px; text-align:center;">
<img id="largeImage" ><br>
<a href="enable.ht ml" onClick="displa yGallery(); return false;">Go
back</a>
</div>
<div id="theGallery " style="display: block;">
<a href="enable.ht ml" onClick="displa yImage('imgs/large/large1.jpg');
return false;">
<img src="imgs/thumbs/thumb1.jpg" width="90" height="120" border="0">
</a></div>

Feb 3 '06 #1
3 2280
DoomedLung wrote:
I have been developing an image gallery which needed to be dynamic as
possible.

so I have placed the gallery in a div plus a div containing the large
image to be displayed. It works by changing the display property of the
gallery div to 'none' and the largeImage div to 'block' which has an
affect of switching pages but obviously saving time developing a single
page for each large Image, but (cliche') when I refresh the page with
the large Image div displaying 'block' it reverts the gallery and
largeImage display's back to their default states.

how can i prevent these states from reverting back to their default
states?


You can't.

HTML is stateless - when you refresh the page, you reload the page's
initial state. All varaibles, etc. previously defined in javascript are
gone.

Feb 3 '06 #2
That's right. You'd have to use some sort of server side technology to
remember the state of things.

JJ

Feb 3 '06 #3
Lee wrote:
DJ Majestik said:

That's right. You'd have to use some sort of server side technology to
remember the state of things.


Or a cookie.


Doh - I hate it when I miss the obvious :P

Feb 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
6934
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the JavaScript in this code from a couple different sites but I'm not 100% sure what each line is doing...This is the ASP code that I'm using for the page....Take a look at the JavaScript code and please let me know what each line is doing....I have been...
4
1535
by: RL Stevenson | last post by:
Often I want to change the Enable or Visibility on a control when some other control on the form changes. Or maybe I need to make a change to the DataSource on a combo box when the user makes a selection elsewhere on the form. In Visual FoxPro, you would call Refresh on the form causing Refresh to be called on all the controls on the form, causing the Refresh event code to be called and allowing the controls to update themselves to the...
0
5828
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database which indexes computer magazine articles for personal reference. I am developing a Visual Basic.NET program whose sole purpose is to enter new records into the database. No updates to existing entries, no deletions, and no display
3
1178
by: Marc Robitaille | last post by:
Hello, I have a Web page with several ASPX Textbox. I added to my page a property which enables me to know the state of this one. The values of this property are: Consultation Modified New Deleted
5
548
by: Sean | last post by:
Problem with sessions I have created an application without concern for sessions. As it turns out I think that might be my undoing. What I have: I have an online quiz. I don’t need to know users or save any data. If the application crashes or user exits the program they should simply start again. Pretty basic. All interactions are stored in an array (not much going on to save to a
4
2368
by: DoomedLung | last post by:
I have been developing an image gallery which needed to be dynamic as possible. so I have placed the gallery in a div plus a div containing the large image to be displayed. It works by changing the display property of the gallery div to 'none' and the largeImage div to 'block' which has an affect of switching pages but obviously saving time developing a single page for each large Image, but (cliche') when I refresh the page the with the...
1
4533
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
70
4350
by: Anson.Stuggart | last post by:
I'm designing a debounce filter using Finite State Machine. The FSM behavior is it follows the inital input bit and thinks that's real output until it receives 3 consecutive same bits and it changes output to that 3 consecutive bit until next 3 consecutive bits are received. A reset will set the FSM to output 1s until it receives the correct input and ouput. This is the test sequence with input and correct output. 1 0 0 1 0 1 0 0 0 1...
4
2405
by: laktofil | last post by:
This may seem like an abstract question on behavioral inheritance. Anyway, I'm building a hierarchical state machine in C++ (with gcc for target platform Gentoo Linux). More precisely, I'm using this framework: Practical Statecharts in C/C++: Quantum Programming for Embedded Systems (hopefully, you don't have to know it to answer my question). Summary is that a state is represented as a function and state changes are handled by...
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.