[jQuery] clueTip onclick call from JS and positioning

2009-02-19 Thread *Davide*

Hello,

Problem:
To show a clueTip when the user clicks
To show the clueTip at the mouse click position
To change dynamically the attr rel

I define the div that will contain the html page to put in

test

$().ready(function()
{
$('div#tip').cluetip({
width:'300',
height:'600',
cluetipClass: 'jtip',
positionBy: "mouse",
activation : "click",
arrows: true,
dropShadow: false,
//hoverIntent: true,
sticky: true,
mouseOutClose: false,
closePosition: 'title',
closeText: ''
});


When the user clicks on a map I call:

$(ShowClueTip(response.responseText));

(function() {
ShowClueTip= function(response) {
$("div#tip").attr("rel", response);
$("div#tip").attr("href", response);
   $("div#tip").show('fast');
$('div#tip').trigger('click');
$("p#test").hide("slow");
}
})();

The p#test is hidden, it means that the function is correctly called,
but the ClueTip is not visible.
If I put the rel value into the div declaration, the ClueTip is
visible, but the position is not correct.
How can I do?

Thanks!




[jQuery] clueTip call from javascript

2009-02-18 Thread *Davide*

Hello All,

I need to implement this functionality using clueTip (great Karl for
the plugin)
Using OpenLayers if a user clicks on a point:

OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control,
{**
},
trigger: function(e)
{
//AJAX call
var url = "../libs/ajax/identify.php?type=map&*"
OpenLayers.loadURL(url, '', this, getPopUpPoint);

***
**

function getPopUpPoint(response)
{
if (response.responseText.indexOf('no result') == -1)
{
   // response.responseText = 
http://www.website/data/page_12_89000.html
CreateClueTip(response.responseText);
}
else
{
alert("No result");
}
}

The variable response.responseText is the html page (rel or href) to
open within the clueTip.

And I declared:



$().ready(function()
{
$('.tip').cluetip({
width:'300',
height:'600',
  cluetipClass: 'jtip',
  arrows: true,
  dropShadow: false,
  hoverIntent: false,
  sticky: true,
  mouseOutClose: false,
  closePosition: 'title',
  closeText: ''
});

***

function CreateClueTip(html_page)
{
//change rel value with html_page
$('.tip').trigger('mouseover');
}


>From JS I call the function CreateClueTip and it has to make visible
the  and it has to change the rel value with  the
response.responseText (html page path), is that possible?

I checked this:
http://groups.google.it/group/jquery-en/browse_thread/thread/5bc757451f2ebf8c?q=cluetip+from+javascript#aa4a2ffb8d2b2382

I need to call the CreateClueTip when the user clicks on the map
(trigger: function(e)) and it doesn't work, why?


Thanks!



[jQuery] ajax error handling troubles

2008-11-16 Thread Davide

$.ajax({
async: true,
url: testingURL,
success: function () {
location.reload();
},
error: function (XMLHttpRequest, textStatus, 
errorThrown) {
console.log('error throw');
console.log(errorThrown);
}
});

the requested page can return  404 or 403 error codes
but the errorThrown variable is ALWAYS undef...
any idea ??