jQuery not working inside Fancybox ?!

This is a discussion on jQuery not working inside Fancybox ?! within the Javascript forums, part of the Development category; Hi there, I use Fancybox to call my contact page via the ajax method. Inside my contact form I use ...


Reply
 
LinkBack Thread Tools Display Modes
Old 6th April 2010, 08:56 AM   #1
moderator
 
kozata-xakep's Avatar
 
Join Date: Feb 2010
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
kozata-xakep will become famous soon enough
Expertise: Web Development
Experience: Professional
Send a message via Skype™ to kozata-xakep
Default jQuery not working inside Fancybox ?!

Hi there,
I use Fancybox to call my contact page via the ajax method. Inside my
contact form I use jQuery Blinking Fields:

html:


<input type="text" class="blink" title="foo bar" value="foo bar">


jQuery:


$(function(){

$('.blink').
focus(function() {
if(this.title==this.value) {
this.value = '';
}
}).
blur(function(){
if(this.value=='') {
this.value = this.title;
}
});
})
--------------------------------------------------------------------------------------------------------------------------------------------------------------
The fancybox works fine except that the blinking fields don't not work
inside. Do you have any ideas how to fix that ?

I'm providing you a demo version. The site is on bulgarian language so

you have to follow these steps:

http://demo.web380.com


1. When prompted for username and password use:

1.2 username: demo
1.3 password: demo
2. On the home page use the top navigation. Click on far right link
labeled <ЗА КОНТАКТИ>. Тhen you will see the contact page with
fancybox. The form fields should <blink> when you click inside.
kozata-xakep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 6th April 2010, 03:23 PM   #2
Senior Member
 
Join Date: Jan 2009
Posts: 980
Thanks: 56
Thanked 14 Times in 14 Posts
Michael is on a distinguished road
Default

Im not getting any blink on the form fields here and to be honest I think it looks great without, I dont have any ideas on getting that fixed though :)
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 11th April 2010, 10:57 AM   #3
moderator
 
kozata-xakep's Avatar
 
Join Date: Feb 2010
Posts: 50
Thanks: 0
Thanked 11 Times in 11 Posts
kozata-xakep will become famous soon enough
Expertise: Web Development
Experience: Professional
Send a message via Skype™ to kozata-xakep
Default

Quote:
Originally Posted by Michael View Post
Im not getting any blink on the form fields here and to be honest I think it looks great without, I dont have any ideas on getting that fixed though :)
Well, they don't blink because they don't work. This method is used when you don't have labels, but you have to show the user what's that field. And It's a lot easier to click and get a blank field instead of click and remove the value.
kozata-xakep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 11th April 2010, 12:11 PM   #4
admin
 
Frinkky's Avatar
 
Join Date: Dec 2008
Posts: 717
Thanks: 0
Thanked 38 Times in 38 Posts
Frinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond reputeFrinkky has a reputation beyond repute
Expertise: Design & Graphics
Experience: Professional
Default

All I can suggest is that as the form does not appear to exist in the current document until after your function it will not be affected by it. Assuming the contact form is held in a separate file and loaded by ajax, try adding function after the contact form markup.
__________________
Jon Warner
Web Pro Cafe :: The PixelForge :: Follow my Twits (or something) :: LinkedIn
Frinkky is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Reply

Tags
fancybox, inside, jquery, not-working

Thread Tools
Display Modes