Note that there are some explanatory texts on larger screens.

plurals
  1. POPlacing a floating info panel
    primarykey
    data
    text
    <p>I'm using Jame Ferreira's Google Script: Enterprise Application Essentials to create a product page (Chapter 5). I've created the app that displays thumbnails of the products all on a page, and then the info panel with more detail that pops up when the user mouses over. It's using CSS to achieve this styling. </p> <p>Problem comes in when placing the info panel. It pops up in only one location, as opposed to being tied to the thumbnail with which it is associated. </p> <p>Here's the code related to the info panel. I believe the problem exists in the placement of the last few lines, but have tried everything I can think of: </p> <pre><code>function onInfo(e){ var app = UiApp.getActiveApplication(); var id = e.parameter.source; for (var i in productDetails){ if(productDetails[i].id == id){ var r = 50; var c = 0; var infoPanel = app.createVerticalPanel().setSize('300px', '300px'); var horzPanel = app.createHorizontalPanel(); var image = app.createImage(productDetails[i].imageUrl).setHeight('100px'); var title = app.createLabel(productDetails[i].title); horzPanel.add(image); horzPanel.add(title); var description = app.createLabel(productDetails[i].description); infoPanel.add(horzPanel); infoPanel.add(description); applyCSS(infoPanel, _infoPanel); applyCSS(image, _infoImage); applyCSS(horzPanel, _infoBoxSeparator); applyCSS(title, _infoTitle); applyCSS(description, _infoDescription); app.getElementById('infoGrid').setVisible(true) .setWidget(0,0, infoPanel); break; } c++ if (c == 3){ c = 0; r = r+250; } switch (c) { case 0: c=250; break; case 1: c=500; break; case 2: c=250; break; } } var _infoLocation = { "top":r+"px", "left":c+"px",} applyCSS(infoPanel, _infoLocation); return app; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload