473,385 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Image Help...

I am working on some code that is currently in javascript that I would
like to be able to do in CSS if possible and 100% eliminate JS. At the
URL http://www.aerosmithfans.com/index2.html there is a series of 4 CD
cover images with a scroll button on each side. When the user clicks
the button, the selection of the four CD covers changes. Is there a way
to code this so that it is purely CSS and no JS what-so-ever? If so can
someone please point me to a site that describes what I need? Thanks
because right not this -> http://www.pczero.net/hello.html <- is how I
am feeling!

Sep 18 '05 #1
4 1530
Change PH to F... wrote:
I am working on some code that is currently in javascript that I would
like to be able to do in CSS if possible and 100% eliminate JS. At the
URL http://www.aerosmithfans.com/index2.html there is a series of 4 CD
cover images with a scroll button on each side. When the user clicks
the button, the selection of the four CD covers changes. Is there a way
to code this so that it is purely CSS and no JS what-so-ever? If so can
someone please point me to a site that describes what I need? Thanks
because right not this -> http://www.pczero.net/hello.html <- is how I
am feeling!


Maybe a CSS guru can do the job, but it may be useful to describe the
issue you are trying to overcome - CSS may not be the solution.

Depending on your reasons, it might also help to post in
comp.lang.javascript. Most of the code in the page can be significantly
reduced - for example, the 50-odd lines of 'CacheCDCovers()' can be
replaced with:

var imagemain=[];

function CacheCDCovers2()
{
var i=0;
while ( i<25 ){
imagemain[i] = new Image();
imagemain[i].src = 'imgs/cd' + (++i) + '.jpg';
}
}
Browser sniffing such as:

if (parseInt(navigator.appVersion)>=3) {

is completely unnecessary (and quite useless - Firefox 1.0.6 reports as
5.0).

The scroll left/right function can be achieved in about 10 lines (or
less). The page can remain fully functional if scripting is unavailable.
--
Rob
Sep 19 '05 #2
In article <kd*****************@news.optus.net.au>, rg***@iinet.net.au
says...
Change PH to F... wrote:
I am working on some code that is currently in javascript that I would
like to be able to do in CSS if possible and 100% eliminate JS. At the
URL http://www.aerosmithfans.com/index2.html there is a series of 4 CD
cover images with a scroll button on each side. When the user clicks
the button, the selection of the four CD covers changes. Is there a way
to code this so that it is purely CSS and no JS what-so-ever? If so can
someone please point me to a site that describes what I need? Thanks
because right not this -> http://www.pczero.net/hello.html <- is how I
am feeling!


Maybe a CSS guru can do the job, but it may be useful to describe the
issue you are trying to overcome - CSS may not be the solution.

Depending on your reasons, it might also help to post in
comp.lang.javascript. Most of the code in the page can be significantly
reduced - for example, the 50-odd lines of 'CacheCDCovers()' can be
replaced with:

var imagemain=[];

function CacheCDCovers2()
{
var i=0;
while ( i<25 ){
imagemain[i] = new Image();
imagemain[i].src = 'imgs/cd' + (++i) + '.jpg';
}
}
Browser sniffing such as:

if (parseInt(navigator.appVersion)>=3) {

is completely unnecessary (and quite useless - Firefox 1.0.6 reports as
5.0).

The scroll left/right function can be achieved in about 10 lines (or
less). The page can remain fully functional if scripting is unavailable.


Thanks for pointing out the shorthand on the caching code. I had used
that from another site I run where the pic names are not even close to
similar and thus the shirt hand was not quite as clean.

I basically wanted to eliminate the javascript as much as possible so
that even guests to the site who use a browser w/o javascript would be
able to have the full functionality of the CD covers scrolling. I was
thinking (maybe incorrectly) that trying to do this with CSS would be
a way to accomplish that task.

Thanks...
Sep 19 '05 #3
Change PH to F... wrote:
I am working on some code that is currently in javascript that I would
like to be able to do in CSS if possible and 100% eliminate JS.


I think you miss the point of CSS, and to answer your question: no CSS
can not eliminate Javascript. What you are doing is a perfectly
reasonable use of Javascript. CSS can not do that nor should it.

Sep 19 '05 #4
In article <11**********************@g47g2000cwa.googlegroups .com>,
lo********@gmail.com says...
Change PH to F... wrote:
I am working on some code that is currently in javascript that I would
like to be able to do in CSS if possible and 100% eliminate JS.


I think you miss the point of CSS, and to answer your question: no CSS
can not eliminate Javascript. What you are doing is a perfectly
reasonable use of Javascript. CSS can not do that nor should it.

OK thanks. I was informed that what I was doing was able to be
replicated in CSS. I couldnt figure out how to do it and maybe now I
know why!

:)

Sep 20 '05 #5

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

Similar topics

5
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove...
2
by: Mekon | last post by:
I have never written a line of script in my life but I need some help with it now. I have this auto generated code which I want to modify if possible The script generates a strip of...
3
by: CanyonJ | last post by:
I've been running into a frustrating problem for a while now. I use image.FromStream to open a tif, then perform some drawstring methods, and then save the file again. The tiffs are in 1 bit per...
21
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
6
by: Saya | last post by:
Hello, This is a repost 'cause I haven't solve the problem: I can't use the System.Drawing class 'Image.FromStream' in the CompactFramework environment. What I've done with respect to Brendan's...
2
by: VicVic | last post by:
Hello Experts, I have 3 questions about Image and Bitmap, and hope you can help me. 1. Could any one tell me the difference between Image and Bitmap? I did take a look of the 2 classes, but...
68
by: Nak | last post by:
Hi there, This might sound like a silly question but, technically could an image object be used for any image format? For example if I were to make plugins for my application, could they be...
0
by: ameshkin | last post by:
Hi, Im pretty new at PHP and need help with something very simple. I wrote a function which watermarks an image. The function works, but i can't figure out how to output the image into a file. ...
2
praclarush
by: praclarush | last post by:
I need to take an image that was in a Array object image and have it display in a table. this is for a item list the table has four columns one for the image, one for a description, one for a price,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.