Commit 2fcc30a0ca6f7834c477b70b87f4b8ab7dec6a13
1 parent
3c6209a0
Веталь
Showing
1 changed file
with
15 additions
and
12 deletions
Show diff stats
frontend/views/catalog/product.php
| ... | ... | @@ -176,16 +176,19 @@ $this->registerJs (" |
| 176 | 176 | </div> |
| 177 | 177 | <div class="both"></div> |
| 178 | 178 | </div> |
| 179 | - | |
| 180 | 179 | <?php |
| 181 | -//$this->registerJs (" | |
| 182 | -// var productHash = window.location.hash; | |
| 183 | -// productHash = productHash.replace('#','') | |
| 184 | -// | |
| 185 | -// var productUl = $('ul.product_mod li') | |
| 186 | -// var productA = productUl.find('a#'+productHash) | |
| 187 | -// productUl.removeClass('active') | |
| 188 | -// productA.parent().addClass('active') | |
| 189 | -// console.log(productA) | |
| 190 | -// ", View::POS_READY, 'new_script'); | |
| 191 | -//?> | |
| 192 | 180 | \ No newline at end of file |
| 181 | +$this->registerJs (" | |
| 182 | + var productHash = window.location.hash; | |
| 183 | + productHash = productHash.replace('#','') | |
| 184 | + | |
| 185 | + var productUl = $('ul.product_mod li') | |
| 186 | + var productA = productUl.find('a#'+productHash) | |
| 187 | + productUl.removeClass('active') | |
| 188 | + productA.parent().addClass('active') | |
| 189 | + var dataLink = productA.attr('data-imageoriginal') | |
| 190 | + var dataImg = productA.attr('data-image') | |
| 191 | + | |
| 192 | + $('#pic').attr('src',dataImg) | |
| 193 | + $('#pic').parent().attr('href',dataLink) | |
| 194 | + ", View::POS_READY, 'new_script'); | |
| 195 | +?> | |
| 193 | 196 | \ No newline at end of file | ... | ... |