Preload fullsize images for quicker display
This commit is contained in:
parent
1247e84108
commit
a40b87dbe0
@ -9,6 +9,17 @@
|
|||||||
$theme->pagination = new Pagination();
|
$theme->pagination = new Pagination();
|
||||||
$theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count,"items_per_page" => $page_size,"style" => "classic"));
|
$theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count,"items_per_page" => $page_size,"style" => "classic"));
|
||||||
$children_offset = ($theme->pagination->current_page -1) * $page_size ; ?>
|
$children_offset = ($theme->pagination->current_page -1) * $page_size ; ?>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<? for($i=0;$i<$children_count;$i++): ?>
|
||||||
|
<? $child = $children_all[$i] ?>
|
||||||
|
<? if ($child->is_photo()): ?>
|
||||||
|
image_url[img_count] = "<?=$child->file_url()?>";
|
||||||
|
img_count++;
|
||||||
|
<? endif ?>
|
||||||
|
<? endfor ?>
|
||||||
|
</SCRIPT>
|
||||||
|
|
||||||
<ul id="gAlbumGrid">
|
<ul id="gAlbumGrid">
|
||||||
<? if (count($children)): ?>
|
<? if (count($children)): ?>
|
||||||
<? for($i=0;$i<$children_offset;$i++): ?>
|
<? for($i=0;$i<$children_offset;$i++): ?>
|
||||||
|
@ -10,6 +10,17 @@
|
|||||||
$theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count,"items_per_page" => $page_size,"style" => "classic"));
|
$theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count,"items_per_page" => $page_size,"style" => "classic"));
|
||||||
$children_offset = ($theme->pagination->current_page -1) * $page_size ; ?>
|
$children_offset = ($theme->pagination->current_page -1) * $page_size ; ?>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<? for($i=0;$i<$children_count;$i++): ?>
|
||||||
|
<? $child = $children_all[$i] ?>
|
||||||
|
<? if ($child->is_photo()): ?>
|
||||||
|
image_url[img_count] = "<?=$child->file_url()?>";
|
||||||
|
img_count++;
|
||||||
|
<? endif ?>
|
||||||
|
<? endfor ?>
|
||||||
|
</SCRIPT>
|
||||||
|
|
||||||
|
|
||||||
<ul id="gAlbumGrid">
|
<ul id="gAlbumGrid">
|
||||||
<? for($i=0;$i<$children_offset;$i++): ?>
|
<? for($i=0;$i<$children_offset;$i++): ?>
|
||||||
<? $child = $children_all[$i] ?>
|
<? $child = $children_all[$i] ?>
|
||||||
|
@ -76,6 +76,11 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body <?= $theme->body_attributes() ?>>
|
<body <?= $theme->body_attributes() ?>>
|
||||||
|
<script type="text/javascript">
|
||||||
|
preload_image_object = new Image();
|
||||||
|
image_url = new Array();
|
||||||
|
var img_count = 0;
|
||||||
|
</script>
|
||||||
<?= $theme->page_top() ?>
|
<?= $theme->page_top() ?>
|
||||||
<div id="doc4" class="yui-t5 gView">
|
<div id="doc4" class="yui-t5 gView">
|
||||||
<?= $theme->site_status() ?>
|
<?= $theme->site_status() ?>
|
||||||
@ -167,5 +172,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?= $theme->page_bottom() ?>
|
<?= $theme->page_bottom() ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
if (img_count > 0){
|
||||||
|
for(var i=0;i<=img_count;i++){
|
||||||
|
preload_image_object.src = image_url[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -6,6 +6,17 @@
|
|||||||
$theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count_true,"items_per_page" => $page_size,"style" => "classic"));
|
$theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count_true,"items_per_page" => $page_size,"style" => "classic"));
|
||||||
$children_offset = ($theme->pagination->current_page -1) * $page_size ; ?>
|
$children_offset = ($theme->pagination->current_page -1) * $page_size ; ?>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<? for($i=0;$i<$children_count;$i++): ?>
|
||||||
|
<? $child = $children_all[$i] ?>
|
||||||
|
<? if ($child->is_photo()): ?>
|
||||||
|
image_url[img_count] = "<?=$child->file_url()?>";
|
||||||
|
img_count++;
|
||||||
|
<? endif ?>
|
||||||
|
<? endfor ?>
|
||||||
|
</SCRIPT>
|
||||||
|
|
||||||
|
|
||||||
<div id="gSearchResults">
|
<div id="gSearchResults">
|
||||||
<h2><?= t("Results for <b>%term</b>", array("term" => $q)) ?></h2>
|
<h2><?= t("Results for <b>%term</b>", array("term" => $q)) ?></h2>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user