jQuery4PHP Current Release: v1.7.0 - Stable

jQuery version: v1.8.2

jQueryUI version: Stable (1.8.24: jQuery 1.3.2+)

jQuery4php API

Miscellaneous

Hide navigator Hide source code

Each

Iterate over a jQuery object, executing a function for each matched element.
<div>
<input type="button" value="Get Values" id="btnForEach" />
<ul id="lstItems">
  <li style="padding:0px">Item 1</li>
  <li style="padding:0px">Item 2</li>
  <li style="padding:0px">Item 3</li>
  <li style="padding:0px">Item 4</li>
</ul>
<?php
echo
YsJQuery::newInstance()
  ->onClick()
  ->in('#btnForEach')
  ->execute(
    YsJQuery::each()
    ->in('#lstItems li')
    ->handler(
      new YsJsFunction(
          sprintf('alert(index + ": " + %s)', YsJQuery::text()->in('this'))
          ,'index'
      )
    )
  )
?>
</div>

  • Item 1
  • Item 2
  • Item 3
  • Item 4

Comments

  • Support requests, bug reports, and off-topic comments will be deleted without warning.

blog comments powered by Disqus

About

Demos

jQueryUI

Plugins Support - New!

Components - New!

Project Developed by The YepSua Team
SourceForge.net