Jump to content
php.lv forumi
  • 0

visibility


zzin32

Question

Sadūros ar problēmu, varbūt kāds spečuks palīdzēs ...

parādu uz vienkārša piemēra:

 

iekš stiliem ir sekojošs bloks:

body.st p.st {

display: none

}

 

html:

 

<body class="">

<p id="p1" class="st">1111</p>

<p id="p2" class="st">2222</p>

<p id="p3" class="st">3333</p>

<p id="p4">4444</p>

<p id="p5" class="st">5555</p>

</body>

 

Visi 5 paragrāfi redzami.

Ja iekš body bloka ieliek klasi "st", būs redzams tikai 4. paragrāfs. Tiktāl viss labi.

Bet kā ar javascript (vai izmantojot ajax) var šitādam gadījumam var noteikt, vai konkrētais paragrāfs ir reāli redzams uz ekrāna???

$("p1").visible() neder, jo atgriež true, bet 1. paragrāfs šādā gadījumā nebūtu redzams uz ekrāna.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...