SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    How do you select this?

    How do I select the <a> tag with class="lightbox" from these codes below using jQuery,
    Code:
    	<div class="row">
    	  <div class="span12">
    		<div id="paginate" align="left">			
    			<table width="1170" border="0">
    			  <tr>
    			    <td width="70">&nbsp;</td>
    			    <td width="1000" align="left">
    					<?php
    						echo $this->pagination->create_links();
    						echo '<br><br>';
    												
    					if(!empty($records)) {
    						foreach($records as $record) {
    					?> 
    						<table border="0">
    							<tr>
    								<td align="left">
    									<a href="<?php echo base_url().'images/'.$record['photo_url']; ?>" class="lightbox">
    										<img src="<?php echo base_url() . 'icons/' . 'camera.jpg'; ?>" alt="<?php echo $record['photo_url']; ?>" />
    									</a>
    									<a href="<?php echo site_url('main/show_offer/' . $record["video_url"]); ?>">
    										<img src="<?php echo base_url() . 'icons/' . 'play.jpg'; ?>" alt="<?php echo $record['video_url']; ?>" />
    									</a>
    								</td>
    							</tr>
    							<tr>
    								<td align="left">
    									<a href="<?php echo $record["title_url"]; ?>">
    										<?php echo '<h2>'. $record['title'] .'</h2>'; ?>
    									</a>
    								<?php
    									echo ' '. $record['description'];
    									if($record['version'] != 0){
    										echo '<br><b>Version:</b> '. $record['version'];
    									}
    									if($record['last_update'] != '0000-00-00'){
    										echo '<br><b>Last update:</b> '. $record['last_update'];
    									}
    									if($record['date_started'] != '0000-00-00'){
    										echo '<br><b>Date started:</b> '. $record['date_started'];
    									}
    									if($record['date_finished'] != '0000-00-00'){
    										echo '<br><b>Date finished:</b> '. $record['date_finished'];
    									}
    									if($record['technology'] != ''){
    										echo '<br><b>Technology:</b> '. $record['technology'];
    									}
    									echo '<br><br>';
    								?>
    								</td>
    							</tr>							
    						</table>
    					<?php 
    						} 
    					}
    						
    						echo $this->pagination->create_links();						
    					?>			    	
    			    </td>
    			    <td width="100">&nbsp;</td>
    			  </tr>
    			</table>
    	  		<br><br>			
    		</div>	  	
    	  </div>
    	</div>
    I tried these codes below but it did not work,
    Code:
        <script type="text/javascript">
    	    $(function() {
    	        $('a.lightbox').lightBox();
    	    });
        </script>

    Can some give shed to this please.
    Thank you very much in advanced.
    Quality codes are optimized and tested...
    Click here for inspiration..

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,046
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    $('a.lightbox') should work (i.e. it should select all anchor tags with a class of lightbox).
    Could yu post a link to your page?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •