jquery-svg

jQuery should blur fullscreen background image [duplicate]

只谈情不闲聊 提交于 2019-12-11 22:38:12
问题 This question already has answers here : Gaussian Blur onHover Using jQuery (4 answers) Closed 6 years ago . Hej! I need some jQuery that blurs my fullscreen background image 1000px in the middle (so: margin: 0 auto; width: 1000px;). Here's an example: http://imageshack.us/a/img443/4976/j7qj.jpg I know that this is less a question - but I need some help, because my jQuery (or JS) knowledge is less than basic. Anyway, I hope someone can help me. I'm using this for my fullscreen background

getBBox() returns nothing for rect or path

試著忘記壹切 提交于 2019-12-11 02:05:50
问题 Please refer below rect code. <rect id="container_svg_ChartArea" x="146.8" y="20" width="633.2" height="414" fill="White" stroke-width="1" stroke="Gray"></rect> i tried get the rectangle bounding box value it returns nothing i.e."0" for x=0,y=0,width=0,height=0 $("#container_svg_ChartArea")[0].getBBox() but when i get the attribute for x/y/width/height it returns some value $("#container_svg_ChartArea").attr("x") ->value returned. same for path element as well as rectangle element. what is

Replace an SVG element with another on click

纵饮孤独 提交于 2019-12-10 14:37:13
问题 Hi I am trying to create some interactive content from inkscape images in the format of SVG. I am loading a SVG file through, svg.load from http://keith-wood.name/js/jquery.svg.js I want to add an onclick listener to the loaded svg, so that i can load a different SVG once it is clicked. How do I do this? The approach in the comment below failed. <script type='text/javascript'> //<![CDATA[ function drawSwitch(svg) { var switchElement = svg.load('./3phase_switch.svg', { addTo: true, changeSize:

Zoom to an element - jquery SVG

懵懂的女人 提交于 2019-12-10 10:56:38
问题 Say I have a canvas with svg elements drawn on it. Once i click on the element, i need to change the viewport by zooming and focusing on the element clicked. How do i perform this? I have attached the code. ` <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>jQuery SVG</title> <style type="text/css"> #svgbasics { width: 1250px; height: 500px; border: 1px solid black; } </style> <script type="text/javascript" src="js/jquery.min.js"></script

Positioning a transformed SVG element within an svg-canvas

邮差的信 提交于 2019-12-08 09:43:30
问题 I have written a function that will resize an SVG path, or any shape. However when i use it the path does gets resized but unfortunatetly it also changes position within my svg-canvas. this is my function function output() { var transformw=prompt("Enter your new width"); var transformh=prompt("Enter your new height"); var lastw = svg_1.getBoundingClientRect().width; var lasth = svg_1.getBoundingClientRect().height; newW=transformw/lastw; newH=transformh/lasth; alert(newH); alert(newW);

How do I make dragging SVG elements in Chrome with jQuery work without getting offsets? (Firefox is OK)

余生颓废 提交于 2019-12-07 16:53:55
问题 I am trying to write some code that allows SVG elements to be dragged around. This is pretty easy with jQuery, jQuery UI and jQuery SVG, and works fine in Firefox, but in Chrome when I drag the SVG element, an offset is apparently added to its coordinates. I can't see anything I'm doing wrong, or discover any known bug in this area. I've constructed a small example that illustrates the problem: <html> <head> <title>Foo</title> <style type="text/css"> </style> <script type="text/javascript"

How to get transformed / Rotated SVG path points

柔情痞子 提交于 2019-12-07 13:49:21
问题 I have rotated an SVG path element by setting the attribute transform="rotate(45)" Now how could i get the rotated SVG path points ? When i checked the attribute "d" its still showing the original points [ unrotated ]. 回答1: if you get point through path.getPointAtLength(), than you need to apply the transformation of the path to result. You get the total transform by: var t = path.getTransformToElement( path.ownerSVGElement ); var abspoint = path.getPointAtLength( 0.5 ).matrixTransform( t );

Show loading gif while waiting for ajax response

老子叫甜甜 提交于 2019-12-06 08:17:12
问题 I have a seat chart. When i click a seat, i want to show a loading gif. Seat chart comes from svg document. Seats are svg elements. When ajax response returned, i want to hide loading gif. I wrote code below but it doesnt work. <section> <div class="parent" style="text-align: center;"> <div class="panzoom" style="width: 500px; height:375px;"> <div class="loading" style="display:none" id="loading"><img src="../../Scripts/spinner.jpg" style="width:200px; padding-left:175px;"/></div> </div> <

How to get transformed / Rotated SVG path points

戏子无情 提交于 2019-12-06 03:56:33
I have rotated an SVG path element by setting the attribute transform="rotate(45)" Now how could i get the rotated SVG path points ? When i checked the attribute "d" its still showing the original points [ unrotated ]. philipp if you get point through path.getPointAtLength(), than you need to apply the transformation of the path to result. You get the total transform by: var t = path.getTransformToElement( path.ownerSVGElement ); var abspoint = path.getPointAtLength( 0.5 ).matrixTransform( t ); I have not testes this,but this might be the way... That is good for some points on the path. If the

How do I make dragging SVG elements in Chrome with jQuery work without getting offsets? (Firefox is OK)

我只是一个虾纸丫 提交于 2019-12-06 02:56:38
I am trying to write some code that allows SVG elements to be dragged around. This is pretty easy with jQuery, jQuery UI and jQuery SVG, and works fine in Firefox, but in Chrome when I drag the SVG element, an offset is apparently added to its coordinates. I can't see anything I'm doing wrong, or discover any known bug in this area. I've constructed a small example that illustrates the problem: <html> <head> <title>Foo</title> <style type="text/css"> </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text