Hi there,
I've been using CakePHP since 6 months and never had a single problem
BUT now I have one issue I can't solve. Here it is:
I need to Preload some images for my website. I did it using JQuery
and it perfectly works:
CODE
$(document).ready(function(){
// Preload
$.preloadImages("img/button_home_en_over.gif", "img/
button_portfolio_en_over.gif", "img/button_about_en_over.gif", "img/
button_contact_en_over.gif",
"img/button_portfolio_en_select_over.gif", "img/
button_about_en_select_over.gif", "img/
button_contact_en_select_over.gif",
"img/button_home_es_over.gif", "img/button_portfolio_es_over.gif",
"img/button_about_es_over.gif", "img/button_contact_es_over.gif",
"img/button_portfolio_es_select_over.gif", "img/
button_about_es_select_over.gif", "img/
button_contact_es_select_over.gif",
"img/button_home_ca_over.gif", "img/button_portfolio_ca_over.gif",
"img/button_about_ca_over.gif", "img/button_contact_ca_over.gif",
"img/button_portfolio_ca_select_over.gif", "img/
button_about_ca_select_over.gif", "img/
button_contact_ca_select_over.gif",
"img/button_home_fr_over.gif", "img/button_portfolio_fr_over.gif",
"img/button_about_fr_over.gif", "img/button_contact_fr_over.gif",
"img/button_portfolio_fr_select_over.gif", "img/
button_about_fr_select_over.gif", "img/
button_contact_fr_select_over.gif"
);
// hover
$("#menu_buttons a img").hover(function() {
$(this).attr("src", $(this).attr("src").split(".").join
("_over."));
}, function() {
$(this).attr("src", $(this).attr("src").split("_over.").join
("."));
});
});
// Preload function
jQuery.preloadImages = function()
{
for(var i = 0; i<arguments.length; i++)
{
//alert(arguments[i]);
jQuery("<img>").attr("src", arguments[i]);
}
}
Now I would like to preload some of the images and not all of them
cause 1) it's taking ages 2) I just need some them depending of the
language I use. But in order to do so, I should be able to access some
PHP variables from my JQuery script.
So my question is: is there a way in CakePHP to pass variables to
Javascript / JQuery???
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=.