Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function(){
- function magnum(){
- const screenWidth = window.innerWidth;
- if (screenWidth >= 768) {
- $('#ex1').zoom(
- {
- magnify:1.5,
- }
- );
- };
- }
- function showAtionPrice(){
- var cat_id = $('#ex1').attr('data-root-id');
- if (cat_id == 165||cat_id == 176||cat_id == 184)
- {
- $(".time_buy_sticker").append('<img style="width:100%; z-index:1000" src="/upload/flag_25.png" alt="Скидка 25%" srcset="">');
- $(".catalog-item-prop > .data-price-table").each(function (index, el){
- if (this.hasAttribute("data-rozn-p")){
- var old_price_rozn = $(this).attr('data-rozn-p');
- var new_price_rozn = Math.round(old_price_rozn * 0.75);
- $(this).addClass("action_may").before('<span class="new_price_vew">' + new_price_rozn + '</span>');
- }
- if (this.hasAttribute("data-m-opt-p")){
- var old_price_mopt = $(this).attr('data-m-opt-p');
- var new_price_mopt = Math.round(old_price_mopt * 0.80);
- $(this).addClass("action_may").before('<span class="new_price_vew">' + new_price_mopt + '</span>');
- }
- });
- }
- if (cat_id == 165||cat_id == 176||cat_id == 184){
- // Для мобильной верстки
- $(".formdata-p > span").each(function (index, el){
- if (this.hasAttribute("data-rozn-p-mob")){
- var old_price_rozn_m = $(this).attr('data-rozn-p-mob');
- var new_price_rozn_m = Math.round(old_price_rozn_m * 0.75);
- $(this).addClass("action_may").after('<span class="new_price_vew_mob"> ' + new_price_rozn_m + ' руб</span>');
- }
- if (this.hasAttribute("data-mopt-p-mob")){
- var old_price_mopt_m = $(this).attr('data-mopt-p-mob');
- var new_price_mopt_m = Math.round(old_price_mopt_m * 0.80);
- $(this).addClass("action_may").after('<span class="new_price_vew_mob"> ' + new_price_mopt_m + ' руб</span>');
- }}
- )}
- }
- setTimeout(magnum, 1000);
- setTimeout(showAtionPrice, 1500);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement