[jQuery] Re: help to simplify code
i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] Re: help to simplify code
Thanks Karl That was more then i expected. However the $navigation.find('a') section is a little over my head could add a few comments to that one to help me understand it Terry On Sep 20, 8:49 am, Karl Swedberg k...@englishrules.com wrote: Here is another way you could do it: var bgColors = { services: '#8ac2b7', vision: '#9e97ca', approach: '#e5b120', team: '#cf1858' }; var $navigation = $('#navigation'); $('#bodycopy').children() .bind('mouseenter', function() { $(this).siblings().stop().fadeTo('slow', .2); $navigation.stop().animate({backgroundColor: bgColors[this.id]}, 500); }) .bind('mouseleave', function() { $(this).siblings().stop().fadeTo('slow', 1); $navigation.stop().animate({backgroundColor: '#404040'}, 500); }); $navigation.find('a') .bind('mouseenter mouseleave', function(event) { if (this.id.indexOf('nav') === 0) { var id = '#' + this.id.replace(/^nav/,''); $(id).trigger(event.type); } }); --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Sep 20, 2009, at 10:51 AM, alienfactory wrote: i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] help to simplify code
i would like to know how i could do it better this actualy repeats 3 more time to get the other mouse over states. Please dont write any code i am still learning and would be helpful if anyone could just guide me in the right direction Many Thanks $('#vision, #navvision').hover( function () { $('#services, #approach, #team').stop().fadeTo('slow', .2); $('#navigation').stop().animate({ backgroundColor: #9e97ca }, 500); }, function () { $('#services, #approach, #team').stop().fadeTo('slow', 1); $('#navigation').stop().animate({ backgroundColor: #404040 }, 500); } ); html code div id=navigation class=homenav ul list/div div id=services class=floatlefth1title/h1psome text /pa href=#img src=images/learnmore-light.gif alt= //a/div div id=vision class=floatlefth1title/h1psome text/pa href=#img src=images/learnmore-light.gif alt= //a/div div id=approach class=floatlefth1title/h1psome text/pa href=#img src=images/learnmore-light.gif alt= //a/div div id=team class=floatlefth1Team/h1psome text/pa href=#img src=images/learnmore-light.gif alt= //a/div
[jQuery] Re: help to simplify code
wow really! not sure what to say about that. Here is a development link to the actual project http://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] jquery help
can anyone in the jquery community help me with an issue. the group for fancybox is not very active my problem is the following i am trying to use a callback in the fancybox plugin 'callbackOnStart':function(){ $(.target).css({'visibility': 'hidden'}); this example hides all the classes marked target but i need to only target the actual item being clicked. i tried to use callbackOnStart':function(){ $(this).css ({'visibility': 'hidden'}); but does not seem to work can anyone help me out with this i know this is not a fancybox group so thanks in advance for any suggestion or help Thanks Terry $(.target).fancybox( { 'zoomSpeedIn': 500, 'zoomSpeedOut':300, 'easingIn': 'easeOutCubic', 'easingOut' : 'easeInBack', 'overlayOpacity': 0.5, 'frameHeight': 499, 'frameWidth': 345, 'imageScale': true, 'overlayShow': true, 'callbackOnStart':function(){ $(.target).css ({'visibility': 'hidden'}); }, 'callbackOnClose':function(){ $(.target).css ({'visibility': 'visible'}); } });
[jQuery] Re: jquery help
thanks for responding, fanctbox is a lightbox plugin if you have not already notice, when clicking on a image it loads an ajax requested file it works find the code below will hide all classes with the name target. i need a callback function to hide the item that is clicked i imagine the click handler is handled in the facnybox plugin but that is where my knowledge ends maybe if I set a click handler in call back it will work? you can see what is happening at http://www.macpeeps.com/codabooks Thanks again for any help you guys can offer On Jun 2, 11:58 am, Michael Lawson mjlaw...@us.ibm.com wrote: Hmm, i'm not familiar with fancy box, but I don't see an onclick event being bound to any objects. What should your code do, and what is it doing instead? cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: alienfactory alienfacto...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 06/02/2009 02:51 PM Subject: [jQuery] jquery help can anyone in the jquery community help me with an issue. the group for fancybox is not very active my problem is the following i am trying to use a callback in the fancybox plugin 'callbackOnStart':function(){ $(.target).css({'visibility': 'hidden'}); this example hides all the classes marked target but i need to only target the actual item being clicked. i tried to use callbackOnStart':function(){ $(this).css ({'visibility': 'hidden'}); but does not seem to work can anyone help me out with this i know this is not a fancybox group so thanks in advance for any suggestion or help Thanks Terry $(.target).fancybox( { 'zoomSpeedIn': 500, 'zoomSpeedOut': 300, 'easingIn' : 'easeOutCubic', 'easingOut' : 'easeInBack', 'overlayOpacity': 0.5, 'frameHeight': 499, 'frameWidth': 345, 'imageScale': true, 'overlayShow': true, 'callbackOnStart':function(){ $(.target).css ({'visibility': 'hidden'}); }, 'callbackOnClose':function(){ $(.target).css ({'visibility': 'visible'}); } }); graycol.gif 1KViewDownload ecblank.gif 1KViewDownload
[jQuery] Re: jquery help
ok i added a click handler to the callback 'callbackOnStart':function(){ $('.target').click(function(){$(this).css ({'visibility': 'hidden'}); }); but when clicked on the first time it does nothing but any time after that it work as intended
[jQuery] cycle plugin issue
ok i cant get the easing plugin to work with cycle plugin 1. does cycle 2.65 work with easing 1.3 2. does easing work on the scrollHorz 3. if both of these are true then what am i doing wrong $('#slideshow').cycle({ fx: 'scrollHorz', timeout: 0, speed:1000, prev:'#prev2', next:'#next2', easingIn: 'easeOutCubic', easingOut : 'easeInBack'
[jQuery] general jquery help
can anyone in the jquery community help me with an issue. the group for fancybox is not very active my problem is the following i am trying to use a callback in the fancybox plugin 'callbackOnStart':function(){ $(.target).css({'visibility': 'hidden'}); this example hides all the classes market target but i need to only target the actual item being clicked. i tried to use callbackOnStart':function(){ $(this).css({'visibility': 'hidden'}); but does not seem to work can anyone help me out with this i know this is not a fancybox group so thanks in advance for any suggestion or help Thanks Terry $(.target).fancybox( { 'zoomSpeedIn': 500, 'zoomSpeedOut':300, 'easingIn': 'easeOutCubic', 'easingOut' : 'easeInBack', 'overlayOpacity': 0.5, 'frameHeight': 499, 'frameWidth': 345, 'imageScale': true, 'overlayShow': true, 'callbackOnStart':function(){ $(.target).css({'visibility': 'hidden'}); }, 'callbackOnClose':function(){ $(.target).css ({'visibility': 'visible'}); } });
[jQuery] fancy box or css issue
i am using the fancy box light box plugin but cant figure out one small issue problem: the container div for fancy box scales up to defined size but the ajax loaded file inside the lightbox container does not scale I thought it might be a css issuse but nothing seems to work. Could anyone shed a little light on this. Thanks terry
[jQuery] fancy box or css issue
i am using the fancy box light box plugin but cant figure out one small issue problem: the container div for fancy box scales up to defined size but the ajax loaded file inside the lightbox container does not scale I thought it might be a css issuse but nothing seems to work. Could anyone shed a little light on this. Thanks terry