i have the jquery loading the image gallery part as follows - <script type="text/javascript">
-
-
function mycarousel_itemLoadCallback(carousel, state)
-
{
-
// Check if the requested items already exist
-
if (carousel.has(carousel.first, carousel.last)) {
-
return;
-
}
-
-
jQuery.get(
-
'dynamic_ajax_php.php',
-
{
-
first: carousel.first,
-
last: carousel.last
-
},
-
function(xml) {
-
mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
-
},
-
'xml'
-
);
-
};
-
-
function mycarousel_itemAddCallback(carousel, first, last, xml)
-
{
-
// Set the size of the carousel
-
carousel.size(parseInt(jQuery('total', xml).text()));
-
-
jQuery('image', xml).each(function(i) {
-
carousel.add(first + i, mycarousel_getItemHTML(jQuery(this).text()));
-
});
-
};
-
-
/**
-
* Item html creation helper.
-
*/
-
function mycarousel_getItemHTML(id,url)
-
{
-
return '<img src="' + url + '" width="75" height="75" alt="" />';
-
};
-
-
jQuery(document).ready(function() {
-
jQuery('#mycarousel').jcarousel({
-
// Uncomment the following option if you want items
-
// which are outside the visible range to be removed
-
// from the DOM.
-
// Useful for carousels with MANY items.
-
-
// itemVisibleOutCallback: {onAfterAnimation: function(carousel, item, i, state, evt) { carousel.remove(i); }},
-
itemLoadCallback: mycarousel_itemLoadCallback
-
});
-
});
-
-
</script>
i want that the images should be loaded from the array in php holding the location of the images . my php script is as follows -
-
<?php
-
-
// Array
-
-
-
$total = -1;
-
-
$images = array();
-
$query = "SELECT images_list.loc FROM images_list ";
-
$result = mysql_query($query);
-
confirm_query($result);
-
$images[]=" ";
-
while ($record = mysql_fetch_assoc($result)) {
-
$images[] = $record['loc'] ;
-
-
}
-
$total = count($images);
-
$selected = array_slice($images, $first, $length);
-
-
// ---
-
-
header('Content-Type: text/xml');
-
-
echo '<data>';
-
-
echo ' <total>' . $total . '</total>';
-
-
foreach ($selected as $img) {
-
echo ' <image>' . $img . '</image>';
-
}
-
-
echo '</data>';
-
-
-
-
function confirm_query($r) {
-
if (!$r) {
-
die("Database query failed: " . mysql_error());
-
}
-
}
-
?>
-
but the images don't load into the gallery....someone plz help
1 2029
I didnt read your code. it wont take me anywhere, I would rather suggest you something.
say x.php would be called by ajax request, and it would return an array to the client. here how you can achieve it:
in x.php -
<?php
-
$a[0]='data1';
-
$a[1]='data2';
-
$a[3]='data3';
-
$a[4]='data4';
-
echo "<script>";
-
echo "var jarray=new Array()";
-
for($i=0;$i<count($a);$i++)
-
{
-
echo "jarray[".$i."]='".$a[$i]."'";
-
}
-
echo "</script>";
-
?>
-
in jquery success -
$("#some_hidden_div").html(returned_text_by_PHP);
-
-
//codes to access jarray
-
at this stage you have the array in a usable status,
Sign in to post your reply or Sign up for a free account.
Similar topics
by: OneSolution |
last post by:
Hi All,
Here's what I'm trying to do.
I have a diverse customer base, and as it grows, it's increasingly harder to
figure out what aspect of our web site is selling and what is not. So I've...
|
by: Wonko |
last post by:
Here's my problem if anyone could be so kind to help me out. I assume
it's quite easy for an experienced programmer but I'm not one of them
:)
I have a JavaScript code that:
- displays multiple...
|
by: Mekon |
last post by:
I have never written a line of script in my life but I need some help with
it now.
I have this auto generated code which I want to modify if possible
The script generates a strip of...
|
by: zborisau |
last post by:
Hey good people,
I've been given a problem to solve recently - and stuck with the
solution for a good 4 days already.
i have a link which leads to popup window. the purpose of that popup...
|
by: chris |
last post by:
Firefox seems to be restricting JavaScript image loading. The following
code works fine in all browsers except Firefox:
function loadImage()
{
var objIcon = document.createElement( 'IMG' );...
|
by: byroncheung |
last post by:
i have my own slideshow player (really simple one, which has no image pre-caching) which when it try to change the picture, it simply do a :
document.images.show.src = file;
and then wait for a...
|
by: Sophy |
last post by:
Hi folks,
Now, I am facing problem with canceling image loading.
I have tried:
var img = new Image();
img.src = "path/to/the/image";
// and then I set the img.src to another source
|
by: krishnaraj suresh |
last post by:
Hi ,
I am facing problem with Loading an Image in an aspx page It is taking long Time to Load But once the Image stored in Client-side Cash it is Loading Fast. Is there any way to Store the Image...
|
by: aaronkmar |
last post by:
Trying to get a loading image to spin while the query is loading.
I can get the data div to fade in, but I can't seem to figure out how to get the gif while the query is loading.
I'm using two...
|
by: Magda Balise |
last post by:
http://www.san-juan-island.net/testSite
I am very close to finishing this site as a matter of fact I thought I was done until after checking all the browsers I found IE was not working correctly....
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |