Free javascript Hosting


widge.js

Uploaded on May 23 2022 14:08 by dhruwlalan22

var containerId = 'cntMain_nextbee_widget_frame';

try {
jQuery(window).on('message', function (jEvent) {
var event = jEvent.originalEvent;
var data = '"' + event.data + '"';
if (data.indexOf('resize_') != -1) {
var i = event.data.split('_')[1];
var j = event.data.split('_')[2];
jQuery('#' + containerId).css('height', i + 'px');
}
if (data.indexOf('scrolltop_') != -1) {
jQuery('html, body').animate({ scrollTop: 0 }, 800);
}

if (data.indexOf('scrollto_') != -1) {
var i = event.data.split('_')[1];
var j = event.data.split('_')[2];
var topPos = document.getElementById(containerId).offsetTop + parseInt(i);
jQuery('html, body').animate({ scrollTop: topPos }, 800);
}
});
} catch (err) {
console.log(err);
}

jQuery(document).ready(function (e) {
jQuery('#' + containerId)
.attr('seamless', 'seamless')
.attr('scrolling', 'no')
.css('width', '1px')
.css('min-width', '100%')
.css('*width', '100%');
});

Back to list