/    Sign up×
Community /Pin to ProfileBookmark

Is this possible?

I have placed the following code at [URL=http://www.nova.edu/~rumsey/css/Stereo/Viewer.html]http://www.nova.edu/~rumsey/css/Stereo/Viewer.html[/URL]

I do not get any errors, but I also do not get any actions.

😮 Nothing happens.

What I am trying to do is dynamically increase or decrease the seperation between the two images displayed. The images are slightly offset, so that if fused visually it is possible to view the room in 3-D.

Is what I am trying to do acceptable CSS code? I have been unable to find any information using the search function of this forum that addresses this question of re-positioning the elements of the page from the original location.

I have seen sites that “jiggle” an image. That is not what I am trying to do here, but I assume the coding would be similiar to relocate the image.

Appreciation and thanks for any suggestions.

[code]
<html><head>
<title>Stereo Viewer</title>

<style type=”text/css”></style>

<script language=”javascript” type=”text/javascript”>
<!–
var img_left = 0;
var img_right = 0;

function MoveOut() {
img_left = img_left – 1;
document.getElementById(‘left’).left = img_right.toString()+’px’;
img_right = img_right + 1;
document.getElementById(‘right’).left = img_left.toString()+’px’;
}
function MoveIn() {
img_left = img_left + 1;
document.getElementById(‘left’).left = img_right.toString()+’px’;
img_right = img_right – 1;
document.getElementById(‘right’).left = img_left.toString()+’px’;
}
//–>
</script>

</head><body>
<center>

<img id=”left” src=”bIMG_0185.jpg” height=”250″ width=”300″ style=”position:relative;left:0px;”>
<img id=”right” src=”bIMG_0186.jpg” height=”250″ width=”300″ style=”position:relative;left:0px;”>
<P>
<button onClick=”MoveOut()”>&lt;</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button onClick=”MoveIn()”>&gt;</button>

</center>
</body></html>
[/code]

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 22.2006 — Please reduce the size of the images.

This is one way to do it:&lt;script type="text/javascript"&gt;
&lt;!--
var img_left = 0;
var img_right = 0;

function MoveOut() {
img_left = img_left + 1;
document.getElementById('left').style.left = img_right+'px';
img_right = img_right - 1;
document.getElementById('right').style.left = 310+img_left+'px';
}
function MoveIn() {
img_left = img_left - 1;
document.getElementById('left').style.left = img_right+'px';
img_right = img_right + 1;
document.getElementById('right').style.left =310+img_left+'px';
}
//--&gt;
&lt;/script&gt;&lt;/head&gt;&lt;body&gt;
&lt;center&gt;

&lt;div style="position:relative;width:610px;height:300px;margin:auto;"&gt;
&lt;img id="left" src="Viewer_files/bIMG_0185.jpg" style="position: absolute;left:0;" height="250" width="300"&gt;
&lt;img id="right" src="Viewer_files/bIMG_0186.jpg" style="position: absolute;left:310px;" height="250" width="300"&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;button onclick="MoveOut()"&gt;&amp;lt;--&amp;gt;&lt;/button&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;button onclick="MoveIn()"&gt;-&amp;gt;&amp;lt;-&lt;/button&gt;

&lt;/p&gt;&lt;/center&gt;

Copy linkTweet thisAlerts:
@JMRKERauthorMar 22.2006 — Thanks a bunch Fang. Works like a charm. Extremely fast on the response time as well.

I'll probably spend the next 2 hours deciphering what you did differently from my original attempt as I am somewhat new to the CSS concepts. :o

The images were just for testing purposes and came directly from the camera. I created them by locating a common image point in the camera viewer and moving the camera from the left to right eye as I took the two images. The hard part is keeping pictures equal in the vertical meridian as I switch between eyes.

I think I can print the separated images to some photo paper and create some new stereo images for my old time stereo viewer. Might be a great way to review a trip to the Grand Canyon if I ever get out to that side of the country.

I assume your request for smaller images sizes is to improve the download time to display.

Also, I hope I posted the question to the correct forum as the script contained some "javascript" code. I made the assumption that my problem was in the CSS section.
Copy linkTweet thisAlerts:
@FangMar 23.2006 — I assume your request for smaller images sizes is to improve the download time to display.[/QUOTE] Yes, even local loading is slow!
Also, I hope I posted the question to the correct forum as the script contained some "javascript" code. I made the assumption that my problem was in the CSS section.[/QUOTE] A mix of both, as are many problems. Any incorrectly posted questions are moved by the mods.
×

Success!

Help @JMRKER spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...