[jQuery] Ajax callback + corners + IE
Hello, I'm having problems with microflacid browser. When I call corners, IE (always IE, 6 and 7, not tested with 8) complains about the jQuery corners. More exactly If I try to load modal and put round corners on it by callback IE stop working. It works fine with Firefox 2+, Chrome, Safari and Opera. As expected, the line with error is one that does not exist in my code. Code that causes errors (example): $().ajaxStart(function(){ $.blockUI({ css: { border: '1px solid #FF7F00', width: '250px', padding: '5px', 'text-align': 'center', 'background-color': 'white', opacity: 1, zIndex: '' }, overlayCSS: { backgroundColor:'#000', opacity:'0' }, message: $('#wait'), baseZ: 9901, centerY: true}); $('.blockUI').addClass('rounded'); basic_effects(); } }) what basic_effects does is $('.rounded').corners(' 8px'); Another example of the code with problem: $(#div).load('somefile.php', { data: data }, function() { basic_effects(); }); where somefile.php haves stuff like div class=borderbla bla bla/div or anything with class border. The very helpfull IE error message is: Line: 89 Char: 327 Error: Unknown runtime error Code: 0 Any thoughts on how can I solve without just giving up from IE? (unfortunately, 60% ppl use IE) Thanks in advance, Rodolfo.
[jQuery] Re: Toggle(fn, fn), need to click twice to re-open the content
When I needed something like that, I've discovered the same and got this workaround: $(.title).click(function(){ if($(this).next(.content).is(:hidden) == true) { $(this).next(.content).show().html('a');} } else { $(this).next(.content).hide().html(''); } }); Worked fine with me. I hope you get the idea. Rodolfo. James escreveu: The toggle function keeps track of the click count internally and calls the callback function based on that, and not based on the status of your elements. This means clicking on something else that modifies your elements will not affect the internal toggle count. I suggest, rather than using toggle, use a simple click event and do a condition check of your element and perform your action based on that. On Mar 19, 9:20 am, Rodrigo rodrigo.z...@gmail.com wrote: Hi, I've an issue using .toggle({unction(){}, function(){}); It works fine if I toggle the element, however, if I click on it to open and then hide it through another element (a button), the next time I have to click twice to re-open the content. Example: $(.button).click(function() { $(.title).next(.content).hide(); }); $(.title).toggle(function(){ $(this).next(.content).show().html('a');},function(){ $(this).next(.content).hide().html(''); }); orhttp://zrod.awardspace.com/ Am I missing something? Thanks
[jQuery] Re: remove classes when select option is not selected
Looks like you gathering the data to send via ajax or something, am I right? If so, you would want to try this: $('#yourform') .find(:input, :checkbox, :radio, :password, :hidden) .not(:button, :reset) .each(function() {params[ this.name || this.id || this.parentNode.name || this.parentNode.id ] = this.value;}); All the data from the form will be stored as an array in the var params like 'name': 'value', you can send this as extra params with ajax after converting it to Json, e.g., var json = JSON.stringify(params) $.post('processdata.php', data: json) Then at php, you replace some extra \ by , decode as an array and be happy! Rodolfo. James escreveu: No, it doesn't remove the class when you change the drop-down option. You have to add an onchange event to the select field to tell it to remove the class (from all options) and add the class to the current selected option. On Mar 19, 3:23 am, jjsanders jigalroe...@gmail.com wrote: Hello, When i select something from a selectbox it adds a class to the selected option this way: $('div#tabs input[type=text], select option:selected, input:checked, textarea').addClass('takethis'); But when i select a different option it doesn't remove the class 'takethis' from the option which I first selected. How can I force this? Thanks in advance.
[jQuery] Re: Block UI problem
Hi! I've found a way to work workaround it. I've moved that style at unblockui callback. Thanks. Rodolfo. 2009/2/7 Mike Alsup mal...@gmail.com I'm having problems with BlockUI plugin. For some reason it applies style=poistion: relative; to parent div and this mess up with my contextMenu plugin. Is there any way to disable this? It only does that if the element currently has 'static' position and no, there is no way to disable it. The element being blocked needs to have a non-static position so that the blocking elements can be positioned within. Mike
[jQuery] Re: HELP, how to catch these elements ?
Try this $('table.cbFieldsContentsTab, div.tab-content') If you use Firefox, I recommend Firbug extension which haves a console so you can that try live. Very usefull. Greetings, Rodolfo. 2009/2/6 Ayan ios...@gmail.com Hello, I need a help to catch these HTML elements - Elements - table class=cbFieldsContentsTab cbFields id=cbtf_46/table table class=cbFieldsContentsTab cbFields id=cbtf_2/table table class=cbFieldsContentsTab cbFields id=cbtf_21/table table class=cbFieldsContentsTab cbFields id=cbtf_11/table table class=cbFieldsContentsTab cbFields id=cbtf_20/table div class=tab-content cb_tab_content cb_tab_tab_main id=cb_tabid_40/div div class=tab-content cb_tab_content cb_tab_tab_main id=cb_tabid_24/div What will be the statement ? $
[jQuery] Re: HELP, how to catch these elements ?
Here another methods: If you have more elements than those you can add .find(:contains('cbtf_46'), :contains('cbtf_2') ... ) or you could select them by their ids $(' #first_id, #second_id, , #last_id') Rodolfo. 2009/2/6 Rodolfo Allan rodolfo.al...@gmail.com Try this $('table.cbFieldsContentsTab, div.tab-content') If you use Firefox, I recommend Firbug extension which haves a console so you can that try live. Very usefull. Greetings, Rodolfo. 2009/2/6 Ayan ios...@gmail.com Hello, I need a help to catch these HTML elements - Elements - table class=cbFieldsContentsTab cbFields id=cbtf_46/table table class=cbFieldsContentsTab cbFields id=cbtf_2/table table class=cbFieldsContentsTab cbFields id=cbtf_21/table table class=cbFieldsContentsTab cbFields id=cbtf_11/table table class=cbFieldsContentsTab cbFields id=cbtf_20/table div class=tab-content cb_tab_content cb_tab_tab_main id=cb_tabid_40/div div class=tab-content cb_tab_content cb_tab_tab_main id=cb_tabid_24/div What will be the statement ? $