jQuery hover for colorbox image collection overlay -
i came upon requirement use colorbox or similar jquery lightbox plugin mouse on function fired jquery hover event
this seems place use $.colorbox() , pass collection rel parameter, can’t work..
http://colorpowered.com/colorbox/
.hover , colorbox work when pass href param .. 1 picture
<!doctype html> <html lang="en"> <head> <meta charset=utf-8 /> <title>colorbox examples</title> <style type="text/css"> body{font:12px/1.2 verdana, arial, san-serrif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416ce5; border-bottom:1px solid #416ce5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link media="screen" rel="stylesheet" href="colorbox.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script src="./jquery.colorbox.js"></script> <script> $(document).ready(function(){ $("[rel='example3']").hover( function () { $.colorbox({rel:"example3",width:"800",height:"800"}); }, function () { } ); }); </script> </head> <body> <h2>no transition + fixed width , height (75% of screen size)</h2> <p><a href="./content/ohoopee1.jpg" rel="example3" title="me , grandfather on ohoopee 1.">grouped photo 1</a></p> <p><a href="./content/ohoopee2.jpg" rel="example3" title="me , grandfather on ohoopee 2.">grouped photo 1</a></p> <p><a href="./content/ohoopee3.jpg" rel="example3" title="me , grandfather on ohoopee 3.">grouped photo 1</a></p>
sorry question.. when changed way thinking it.. answer became clear.. colorbox works great click or mouseover of course...
<!doctype html> <html lang="en"> <head> <meta charset=utf-8 /> <title>colorbox examples</title> <style type="text/css"> body{font:12px/1.2 verdana, arial, san-serrif; padding:0 10px;} a:link, a:visited{text-decoration:none; color:#416ce5; border-bottom:1px solid #416ce5;} h2{font-size:13px; margin:15px 0 0 0;} </style> <link media="screen" rel="stylesheet" href="colorbox.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script src="./jquery.colorbox.js"></script> <script> $(document).ready(function(){ $('.example3').colorbox({rel:'example3',width:'75%',height:'75%'}).mouseover(function(){ $(this).click(); }); }); </script> </head> <body> <h2>no transition + fixed width , height (75% of screen size)</h2> <p><a href="./content/ohoopee1.jpg" rel="example3" class="example3" title="me , grandfather on ohoopee 1.">grouped photo 1</a></p> <p><a href="./content/ohoopee2.jpg" rel="example3" class="example3" title="me , grandfather on ohoopee 2.">grouped photo 1</a></p> <p><a href="./content/ohoopee3.jpg" rel="example3" class="example3" title="me , grandfather on ohoopee 3.">grouped photo 1</a></p> </body> </html
Comments
Post a Comment