473,396 Members | 2,002 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,396 software developers and data experts.

How to making transitions respond to onclick?

3
Ive managed a simple hover transition

Expand|Select|Wrap|Line Numbers
  1.  
  2. <style>
  3. #trans {
  4. opacity:100;
  5. transition: all 1st ease-in-out;
  6. }
  7. #trans:hover {
  8. opacity:0;
  9. }
  10. </style>
  11.  

but i would like to make it clickable instead of hover. The only example i found that illustrates clickable transitions is (http://css3.bradshawenterprises.com):

Expand|Select|Wrap|Line Numbers
  1.  
  2. <div id="cf2" class="shadow">
  3.      <img class="bottom" src="/tests/images/Stones.jpg" />
  4.      <img class="top" src="/tests/images/Summit.jpg" />
  5. </div>
  6. <p id="cf_onclick">Click me to toggle</p>
  7.  
  8. #cf2 {
  9.      position:relative;
  10.      height:281px;
  11.      width:450px;
  12.      margin:0 auto;
  13. }
  14. #cf2 img {
  15.      position:absolute;
  16.      left:0;
  17.      -webkit-transition: opacity 1s ease-in-out;
  18.      -moz-transition: opacity 1s ease-in-out;
  19.      -o-transition: opacity 1s ease-in-out;
  20.      transition: opacity 1s ease-in-out;
  21. }
  22.  
  23. #cf2 img.transparent {
  24.      opacity:0;
  25. }
  26. #cf_onclick {
  27.      cursor:pointer;
  28. }               
  29.  
  30. $(document).ready(function() {
  31.      $("#cf_onclick").click(function() {
  32.           $("#cf2 img.top").toggleClass("transparent");
  33.      });
  34. });     
  35.  
  36.  
I tried implementing this but have had no luck and i dont see any way of
adpating this for more complex moves. Anyone know of a simpler way of
making clickable css transitions?
Jan 18 '11 #1
0 1185

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Paul Gardella | last post by:
Folks, Does anyone know of a Python module for building organization charts? I've looked at gdchart and JPGraph, but neither of them do org charts, as far as I can tell. Seems it can be done...
1
by: Bern McCarty | last post by:
Our project consists of some mixed .dlls and recently we noticed that it had slowed down. When I investigated I figured out that some inlineable methods of a native C++ type were compiled into (not...
4
by: Mark Rae | last post by:
Hi, VS.NET 2003 on WinXPPro, both with all the latest patches and updates, etc... I've got a very simple WebForm which is used either to add a new record to a SQL Server database or edit a...
1
by: Dan | last post by:
Hi, I was wondering if anyone could come up with a cross browser image transition that I could use... I have already made one that works in IE but i know it doesn't work in Mozilla Firefox. ...
7
by: extremerep | last post by:
My task is to change the value of a button and then make it functional with the onClick handler. Changing the value to "Play Again" works, but making the onClick work accordingly does not. The...
5
by: Dave | last post by:
I've been given a flash banner and told to make it a hyperlink. I tried this: <script type="text/javascript"> Document.getElementById("flashcontent").onclick = function(){...
12
by: Andrew C | last post by:
Hi, folks. I've recently been doing a few simple tests and experiments. As a result, I've noticed that, in dealing with 'onclick', IE seems less able than Firefox to keep up with rapid clicking....
11
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
6
by: Mufasa | last post by:
I have cell that I want to be able to have the user click the cell anywhere and it will link to somewhere else. I want to use a cell because I want it to be 25% of the width of the screen ( I have...
3
by: zb42 | last post by:
I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects: import fl.transitions.*; import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
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,...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.