Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

Image Help...
 

Change PH to F...




quote this post edit post

IP Loged report this post

Old Post  09-19-05 - 04:22 AM  
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!



Post Follow-Up to this message ]
Re: Image Help...
 

RobG




quote this post edit post

IP Loged report this post

Old Post  09-19-05 - 09:33 AM  
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


Post Follow-Up to this message ]
Re: Image Help...
 

Change PH to F...




quote this post edit post

IP Loged report this post

Old Post  09-19-05 - 12:20 PM  
In article <kdtXe.522$uQ6.26270@news.optus.net.au>, rgqld@iinet.net.au
says...
> Change PH to F... wrote: 
>
> 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...


Post Follow-Up to this message ]
Re: Image Help...
 

logic_earth




quote this post edit post

IP Loged report this post

Old Post  09-19-05 - 12:20 PM  
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.



Post Follow-Up to this message ]
Re: Image Help...
 

Change PH to F...




quote this post edit post

IP Loged report this post

Old Post  09-21-05 - 12:39 AM  
In article <1127123819.499485.291930@g47g2000cwa.googlegroups.com>,
logicearth@XXXXXXXXXX says...
> Change PH to F... wrote: 
>
> 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!

:)



Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 07:10 AM. Post New Thread   
  Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top