- Screen name: vengiss
vengiss's Profile
6 Posts
8 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 27-Feb-2012 12:09 PM
- Forum: Using jQuery Plugins
I'm trying to use Malsup's Cycle plugin with jCarousel to allow thumbnails in my pagination to scroll horizontally and it's working fine. The problem is that sometimes the jcarousel plugin doesn't initialize because I believe the pagination is not ready yet. My code looks like this:
- $('#slideshow').cycle({
- timeout : 0,
- speed : 1000,
- pager : '#image-carousel ul',
- pagerAnchorBuilder: function(idx, slide) {
- return '<li><a href="#"><img src="' + slide.src + '" width="107" height="80" /></a></li>';
- }
- });
- $('#image-carousel').jcarousel();
Sometimes when the page loads the jcarousel doesn't work, I used
setTimeoutto delay its initialization about 2 seconds and it worked every time so I assume it must be because sometimes the pager is not ready. I can live with thesetTimeoutsolution for now but I think there must be a better way to handle this.- Hi, the title of my post might be a little confusing but I'll try to explain what I'm trying to do.
I'm using the forms plugin to submit a form with ajax, the server side php script does something like this (using php):
<?php
$object->function1();
$object->function2();
$object->function3();
$object->function4();
$object->function5();
?>
Everything works fine but my question is, is there any way I can know what function is currently executing? I'd like to display a message that says something like "Processing (function1)" and changes as the script goes on, but I don't know how to get it :(
Thanks in advance!- Hi I have the following table
<table>
<tr>
<td><input /></td>
<td><select> </select><a id="link"></a></td>
</tr>
</table>
I'd like to get the value of the input and select elements when I click the "a" tag with the parents method?, I tried:
var input = $(this).parents('td input').val();
var select = $(this).parents('td select').val();
But I get "undefined", any ideas? Thanks in advance.- Hi, I have the following table:
I just left the relevant parts, its just a list of products I get from a DB, each one has and image (thats loaded on the <div>). I'd like to show on a tooltip eveytime the user hovers over the <img> element I placed on the table, heres the script to do that (I'm using the 'live' function because the user can add new products so I dynamically create a new <img> element):- <table id="mercancia_list" class="tablesorter">
- <thead>
- ...
- </thead>
- <tbody>
- <tr>
- ...
- <td class="tableButton"><img id="preview_<?=$arrMercancia[$i]['id_mercancia']?>" class="preview_boton_mercancia" src="img/buttons/camera.png" /></td>
- ...
- </tr>
- <div id="img_<?=$arrMercancia[$i]['id_mercancia']?>" class="demotip"><img width="90" height="110" src="<?=$arrMercancia[$i]['foto_mercancia']?>" /></div>
- </tbody>
- </table>
This works "almost" as intended the problems are:- $('.preview_boton_mercancia').live('mouseover', function() {
- var id = $(this).attr("id").split("_");
- var id_mercancia = id[1];
- $('#preview_'+id_mercancia).tooltip({
- tip: '#img_'+id_mercancia,
- effect: 'fade',
- });
- });
- $('.preview_boton_mercancia').live('mouseout', function() {
- var id = $(this).attr("id").split("_");
- var id_mercancia = id[1];
- var tooltip = $('#preview_'+id_mercancia).tooltip('#img_'+id_mercancia);
- tooltip.hide();
- });
1) The tooltip doesn't work on the first hover but after the second time the user hovers the <img> element.
2) It doesn't work at all on dynamically created elements.
You can see an example here: http://sm-dev.webege.com/ (login: admin / pass:admin)
Go to Registro -> Mercancia and hover over the preview icon.
Is it something I'm doing wrong? Any help will be appreciated.
Thanks in advance!
PD: This is in FF and Safari, in IE and Opera it won't work at all..- 03-Feb-2010 04:42 PM
- Forum: Using jQuery Plugins
Hi, I've been using the form plugin to process some data in a form and was working perfectly until I added a new input (type="file") to upload images, for some reason now the plugin wont go past the beforeSubmit: section, the weird thing is that if I change the field type to text it works perfectly.
Is it something I'm doing wrong? Or do I have to do something else with file type fields? Here's the code, any help will be appreciated , thanks in advance!!
$('#add_form_mercancia').ajaxForm({
beforeSubmit: function (){
if ($("#add_form_mercancia").valid()==false){
return false;
}alert('TEST'); // <---- Works!
alert('TEST 2'); // <----- Does nothing
},
success: function(r){
if (r){
jAlert(r, 'Error');
$.fn.colorbox.close();
}else{
$('#table_div').load('mercancia.async.php?async=1','',tableSort); // Update table
$.fn.colorbox.close();
}
},
error: function(r){
jAlert('Error ->'+r,'Error');
}
});- Hi I'm currently using the tooltip plugin to display an image preview on mouse over, this is the function that im using:
$('.preview_boton_mercancia').live('mouseover', function() { // image which will display the tooltip on mouseover.
var id = $(this).attr("id").split("_"); // splits the id of the image. ex. id="image_21"
var id_mercancia = id[1]; // gets the id of the image I need. ex. id_mercancia = 21
$('#preview_'+id_mercancia).tooltip('#img_'+id_mercancia); // displays the thumbnail of the image on the tooltip
});
The problem is that it doesnt work on the first mouseover, after I hover the mouse the first time over the icon THEN it works as intended, I dont know if I'm not using the live function correctly or if its a problem with the plugin ??
Does anyone knows what the problem might be? Thanks in advance!
PD: I think the problem has something to do with that I'm just "binding" the event but not actually "calling" it on the mouseover?
PD 2: I just found out that the live function isn't working on newly created elements at all. Just works as described on the elements created when the page first loads.
- «Prev
- Next »
Moderate user : vengiss
© 2012 jQuery Foundation
Sponsored by
and others.


