存储在js var中溢出的文本

时间:2015-09-01 17:14:41

标签: javascript jquery css

我意识到这是一个奇怪的问题,因为它有点矛盾,但我希望能够隐藏不适合div的文本。这很容易,但后来我需要隐藏文本并将其存储在js变量中,以便我可以在单击按钮时使其可见,例如:

MATCH outg=(a)-[og]->(b), incom=(c)-[ic]->(a) RETURN id(a), labels(a) AS Stereotype,count(og) AS out, count(ic) AS in ORDER BY out DESC

JS

<html>
<body>
      <div style = "height:10px;width:50px;word-wrap:break-word;overflow:hidden">
            <p id = "text">Text that is too big for div</p>
      </div>
</body>
</html>

类似的东西。

1 个答案:

答案 0 :(得分:0)

为什么不在点击时删除$id = 1; $stmt = $pdo -> prepare('select id from table where id = ?'); $stmt -> execute(array($id)); $rows = $stmt -> fetch(PDO::FETCH_ASSOC); if (count($rows) > 0) { echo 'update row'; } else { echo 'insert row'; } 属性?

overflow: hidden
var content = document.getElementById('content'),
    button = document.getElementById('unhide');

button.addEventListener('click', function(){
    content.style.overflow = 'visible';
});