javascript - How to stop screen from moving up? -
i working on dashboard using highcharts library, when click on chart screen moves up. using example code can found here:
$(function () { $('#container').highcharts({ chart: { plotbackgroundcolor: null, plotborderwidth: null, plotshadow: false }, title: { text: 'browser market shares @ specific website, 2010' }, tooltip: { pointformat: '{series.name}: <b>{point.percentage:.1f}%</b>' }, plotoptions: { pie: { allowpointselect: true, cursor: 'pointer', datalabels: { enabled: true, color: '#000000', connectorcolor: '#000000', format: '<b>{point.name}</b>: {point.percentage:.1f} %' } } }, series: [{ type: 'pie', name: 'browser share', data: [ ['firefox', 45.0], ['ie', 26.8], { name: 'chrome', y: 12.8, sliced: true, selected: true }, ['safari', 8.5], ['opera', 6.2], ['others', 0.7] ] }] }); });
i've implemented code in sort or dashboard working on can found here: dashboard.
if go dashboard, scroll bit down click on chart can see mean, screen shoots up, annoying, on mobile devices. strange thing is, examples on highcharts website, not have behaviour.
any appreciated.
in case ordinary link click behavior works. browser tries find href, , adds # url , goes up. try add prevent default. .on('click', function() { event.preventdefault(); });
Comments
Post a Comment