I want to click the 'Breadthfirst' to change the layout of the graph, but many times I tried have failed.
What's wrong with me and how I to solve this?
//Here is a list of mine. I want to use 'click' to change the layout of the graph.
<li><a href="" onclick="" id='breathfirst'>Breadthfirst</a></li>
//It's onclick function
<script for='breathfirst' event='onclick' type='text/javascript'>
update('breathfirst');
return false;
</script>
//The main codes to initialize. The default layout is circle.
<script type="text/javascript">
var value='circle';
update(value);
function update(value){
$("#cy").cytoscape({
layout: {
name: value,
fit:true
},
....
}</script>
Thank you!