How to make Image Buttons

  • Updated
  • You can insert images in the content area of your nodes, and be able to click on them to have them behave like buttons. This requires a little HTML coding. Here's how to do it:

    First of all, when editing the content area of a node, you'll need to use the code view tool.

     

    For Example, a JavaScript call would look something like this:

    <a href="#3" onclick="do_button_click(3, 2, 'Kids',0, '0');"><img src="https://s3.amazonaws.com/zingtree-uploads/images%2F1624050471539-kids.jpg"</a>

     

    By adding an on_click() handler to the <a href> tag that surrounds the image, it will act like a button.


    Here's how do_button_click() works:

    do_button_click(to_node_id, from_node_id, button_text, value, button_data) ;

    to_node_id = the node you want to visit next

    from_node_id = the node you are currently on

    button_text = how the click is labeled in your reports.

    value = click score value.  Usually, this can just be set to zero.

    button_data = A text value for the variable, instead of the value parameter. Set value=0 if you want to set a text value for the node variable. Otherwise, just leave this as an empty string.

  • You can insert images in the content area of your nodes, and be able to click on them to have them behave like buttons. This requires a little HTML coding. Here's how to do it:

    First of all, when editing the content area of a node, you'll need to use the code view tool.

     

    In this Gallery example, you can see there is a javascript call like this:

    <a href="#3" onclick="do_button_click(3, 2, 'Kids',0, '0');"><img src="https://s3.amazonaws.com/zingtree-uploads/images%2F1624050471539-kids.jpg"</a>

     

    By adding an on_click() handler to the <a href> tag that surrounds the image, it will act like a button.


    Here's how do_button_click() works:

    do_button_click(to_node_id, from_node_id, button_text, value, button_data) ;

    to_node_id = the node you want to visit next

    from_node_id = the node you are currently on

    button_text = how the click is labeled in your reports.

    value = click score value.  Usually, this can just be set to zero.

    button_data = A text value for the variable, instead of the value parameter. Set value=0 if you want to set a text value for the node variable. Otherwise, just leave this as an empty string.

  • Throughout 2022 Zingtree will be upgrading customers to our new faster and more modern user experience! Here's how to tell which experience your Zingtree Authors are currently using.

    Log in to your Zingtree Author account and navigate to My Trees. How does your current My Trees page look?

    Zingtree Classic

    2022-02-25_12-24-51.png

    New User Experience

    mceclip0.png

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request