[jQuery] Ajax Problem

2009-01-27 Thread saiful.ha...@gmail.com

hi all,

I have 2 file

rating.js
$(document).ready(function() {
  var behav = function(){
$(".rating_class").hover(function(){
  $("#tooltip_star").css({"visibility":"visible", "top":($
(this).offset().top - 60), "left":($(this).offset().left+$(this).width
()+ 2)});
  $.ajax({
type: "POST",
url: $(this).attr("href"),
success: function(msg){
  $("#tooltip_star").html(msg);
}
  });
}, function(){
  $("#tooltip_star").css("visibility","hidden");
}).ajaxStart(function(){
  $("#tooltip_star").html("");
});

$(".rating_class").click(function(){
  location = $(this).attr("href").replace("ajax_", "");
  return false;
});
  }

  behav();
});

there is just call function behav(); to run all sintax in this file,

and i have some ajax sintax in other file file this

$(document).ready(function() {

var mainApp = function(page){
  $.ajax({
type: "POST",
url: "product/related//"+page,
success: function(msg){
  $("#displayRelated").html(msg);
  behav();
}
  });
}

mainApp(1);

});

But i get some error in my firebug like this

behav is not defined
success()()6 (line 652)
success()jquery-1.2.6.js (line 2818)
onreadystatechange()()jquery-1.2.6.js (line 2773)
[Break on this error] behav();

my question is, why my function behav() in rating.js can't called from
success: function(msg){...}, there is need something like global
function?

thang's

~ saiful haqqi ~


[jQuery] double $().read()

2009-01-09 Thread saiful.ha...@gmail.com

hi all,

can we put double $().read() declare? cos i am using tab-ui not in all
page, just in one page only?
is has trick's for this happen

~ saiful haqqi ~



[jQuery] Get TD Position [X, Y]

2009-01-07 Thread saiful.ha...@gmail.com

hi all,

I want make simple sub menu, id mouse over the column of table will
show the div with some text finally.
can i get the XY position foreach column in table?!

JQuery Code

$(".left_menu_td").mouseover(function(){
$("#sub_menu").css({"top":this.position().top,
"left":this.position.left, "display":"block"});
});

HTML code


One
Two
Three



 Sub Menu
from Column 

I am always get undefine this.position().top, can i get jquery object
for each column?

~ saiful haqqi ~


[jQuery] mouseout problem

2009-01-06 Thread saiful.ha...@gmail.com

hi all,

i has a litle problem when using $(IdElement).shie("slow"); this my
code

my JQuery
$(document).ready(function() {
$("#text_span").mouseover(function(){ $("isPopUp").show("slow");});
$("#isPopUp").mouseover(function(){$("#isPopUp").css("display",
"block");});
$("#isPopUp").mouseout(function(){$("#isPopUp").hide("slow");});
}

My HTML




one
two
tree
four



show the div

when my cursor over in text_span, the div showed and that is true.
But, the problem when my cursor over the image the div just gone, hide
with slow.

Where is my incorrect sintax?

When i change the hide("slow") to hide() only, all be fine :(

thang's for help


[jQuery] Newbie question

2009-01-05 Thread saiful.ha...@gmail.com

hi all,

is jquery have function like findXY(element) or scroll position?
sorry not finish read all document about jquery

~ saiful haqqi ~