javascript - Firefox wont recognize fullwidth Polygon with Jquery -



javascript - Firefox wont recognize fullwidth Polygon with Jquery -

i trying accomplish polygon line made javascript. function see there below makes polygon line , places top of div contactpoly.

this function works on chrome , safari, doesn't work on firefox (ie not supported). here screenshot of working example, on chrome

http://tinypic.com/r/k2grxg/8

and here link of not working illustration on firefox.

http://tinypic.com/r/a493jm/8

as can see firefox doesn't seem recognize 100% width of window , cant place breakpoints line. want accomplish create work on firefox js

function drawcontactpolygon() { var docwidth = $(window).width(); var aboutpolygon = snap("##contactpoly"); var polyline1 = aboutpolygon.polyline([0, 20, 0, 100, (docwidth*0.20), 100]); var polyline2 = aboutpolygon.polyline([-1000, 100, (docwidth*0.60), 20, (docwidth*0.60), 100]); var polyline3 = aboutpolygon.polyline([(docwidth*0.599), 20, (docwidth*0.75), 100, (docwidth*0.599), 100]); var polyline4 = aboutpolygon.polyline([(docwidth*0.75), 100, (docwidth), 100, (docwidth), 70]); polyline1.attr({fill: "##fff"}); polyline2.attr({fill: "##fff"}); polyline3.attr({fill: "##fff"}); polyline4.attr({fill: "##fff"}); } drawcontactpolygon();

html

<div class="poly-cutout"> <svg id="contactpoly"></svg> </div>

notes line gets snapped on svg id="contactpolly" svg, not div.

what i've tried i've tried draw them on canvas, dindt elements on total width base.

if have thoughts on how prepare happy,

kind regards

add height="100%" width="100%" attributes on <svg> element.

at point you'll need chrome it's chrome bug doesn't work firefox does.

javascript jquery html css svg

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -