here's the code of kartinkin.php file:
<?php
$node = node_load(707);
node_view($node);
//$index = $_GET['index'];
//dpm($node);
?>
<script type="text/javascript">
$(document).ready(function(e){
$('.small-images a').click(function(e) {
$.get("http://myadress.org/kartinki.php", {"index": index});
e.preventDefault();
});
});
</script>
<?php $index = $_GET['index']; dpm($index); ?>
<div class="imba-slider">
<a class="left-arrow" href="javascript: void(0);">#</a>
<a class="right-arrow" href="javascript: void(0);">#</a>
<div id="big-image-slider">
<?php if ($index == 0): ?>
<?php print theme_imagecache('imba', $node->field_pics[0]['filepath']); ?>
<?php else: ?>
<?php print theme_imagecache('imba', $node->field_pics[$index]['filepath']); ?>
<?php endif; ?>
</div><!--/big-image-slider-->
<div class="small-images">
<?php for ($i = 0; $i <= count($node->field_pics); $i++) { ?>
<a href="?index=<?php print $i; ?>"><?php print theme_imagecache('230x130', $node->field_pics[$i]['filepath']); ?></a>
<?php } ?>
</div><!--/small-images-->
</div><!--/imba-slider-->
I have included that file with include_once()
inside a node.
PROBLEM. When i click on small-image it reloads the page and after reload my big image changes. With a code above i've tried to do it without a page reload, i even write e.preventDefault();
But still after clicking on a preview image it reloads the page. How can i make big image changing without reload?