doujingxi3356 2014-06-12 11:49
浏览 101
已采纳

使用css隐藏显示功能

I am working on hide show functionality using JavaScript

but it occurring error on console for onclick function

I am not getting why this error occurring.

PHP CODE

<?php

$page = '0';

$output.='<div id="my_section" style="display:none;">This is my section</div>';

echo $output;

?>

I page-id is grater than 0 need to display block of div my_section

e.g.

$output.='<div id="my_section" if($page>\'0\') { style="display:none;" } else { style="display:block;" }>This is my section</div>';

i am not getting how to add this condition in php please help

  • 写回答

7条回答 默认 最新

  • dpqaaczn141761 2014-06-12 11:52
    关注
    if($page > 0) { 
        $style = 'style="display:none;"'; 
    } else {
        $style = 'style="display:block;"'; 
    }
    
    $output.='<div id="my_section" ' . $style . '>This is my section</div>';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。