I am using a text effect plugin that works great when I enter text into the text box and click the button, as shown here: http://jsfiddle.net/bushell/5ttdejk3/
However, what I am trying to do is now load the data directly into the #digits div from an external js file. Something like this:
function loadJSON(from, to, petrolPrice, mpg)
{
$.getJSON("http://localhost:8888/petrol/petrolData.php?from="+from+"&to="+to+"&petPrice="+petrolPrice+"&mpg="+mpg, function(data) {
var mins = data.Minutes;
var target = $('#digits');
var output= data.Origin + " " + data.Destination + "-mins:-" + mins + "--" + data.PetrolCost;
document.getElementById("myDiv").innerHTML=output;
target.shuffleText(mins);
});
}
Some reason its not working, any idea why?
如果您的mins
变量是数字,则将不起作用,shuffleText需要一个字符串:
target.shuffleText(''+mins);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.