W3C home > Mailing lists > Public > www-svg@w3.org > June 2000

Changing visibility using JavaScript

From: Stepan Rybar <Stepan.Rybar@ceu.cz>
Date: Tue, 13 Jun 2000 11:12:43 +100
Message-Id: <200006130921.LAA12313@eleven.ceu.cz>
To: www-svg@w3.org
Problem: How can I change visibility (visible|hidden) of some element
(polygon, polyline...) using JavaScript (without interacting the
server)?

Purpose: I have several polygons in SVG file and I want to allow user
to hidden and again show selected polygons (polylines...) with
check/uncheck checkbox (event onChange).

Current situation: I am using MSIE 5.0 with Adobe SVG Viewer 
(latest). I have two files HTML and SVG. HTML file has checkboxes and 
planned JavaScript and floating frame (tag <iframe>), where is SVG 
file. Each polygon has its unique id.

What I do not know: How to write Java Script, which will change one of
style item (visibility) to hidden. I do not know especially how to
reffer to selected style item? I think something like (inside
function)

iframe_name.id_of_polygon.style.visibility = "hidden" 

Is it possible? I do not want to change other style items (fill,
stroke).

Thank You

Stepan Rybar

Czech Environmental Institute
Received on Tuesday, 13 June 2000 05:13:58 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:18 GMT