473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Target="blank" not working properly when using biggerlink jQuery plugin v 1.0

56
hi Pals,
I have a problem regarding the "target" attribute of "a" tag. in my code I use biggerlink jQuery script to give link to p element without come HTML validation problem. I pass the "target" value from PHP to smarty template , but it's not working , When I remove "biggerlink " it works but the link in <p> tag not working . My Tpl file is :


Expand|Select|Wrap|Line Numbers
  1. {if not empty($campaign)}
  2. <div class="securti-adv biggerlink">
  3.     {if not empty ($campaign.media)}
  4.         <a href="{$campaign.url}" {if n($campaign.linkTarget)}target="{$campaign.linkTarget}"{/if} class="thumb">
  5.             <img src="{$campaign.image}" title="{$campaign.title1 + $campaign.title2}" alt="{$campaign.title1 + $campaign.title2}" />    </a>
  6.     {/if}
  7.     <div class="details">
  8.         {if not empty ($campaign.title1) || not empty ($campaign.sub_title)}
  9.             <a href="{$campaign.url}" {if not empty($campaign.linkTarget)}target="{$campaign.linkTarget}"{/if} title="{$campaign.title1 + $campaign.title2}">
  10.                  {text2image styleSlug=$campaign.titleStyle1 text=$campaign.title1}
  11.                  {text2image styleSlug=$campaign.titleStyle2 text=$campaign.title2}
  12.                  <span><img src="{$imagesDir}/btn-campaign-meet-security-advisor.png" alt="" title="" /></span>
  13.             </a>
  14.             <p> {text2image styleSlug=$campaign.subtitleStyle text=$campaign.subTitle}</p>
  15.         {/if}
  16.     </div>
  17. </div>
  18.  
  19. <script type="text/javascript" language="javascript">
  20. {literal}
  21. $(document).ready(function(){
  22.     $('.biggerlink').biggerlink();
  23. });
  24. {/literal}
  25. </script>
  26. {/if}

My plugin code is :



Expand|Select|Wrap|Line Numbers
  1. (function($) {
  2.     $.fn.biggerlink = function(options) {
  3.  
  4.         // Default settings
  5.         var settings = {
  6.             hoverclass:'hover', // class added to parent element on hover
  7.             clickableclass:'hot', // class added to parent element with behaviour
  8.             follow: true    // follow link? Set to false for js popups
  9.  
  10.         };
  11.         if(options) {
  12.             $.extend(settings, options);
  13.         }
  14.         $(this).filter(function(){
  15.              return $('a',this).length > 0;
  16.  
  17.         }).addClass(settings.clickableclass).each(function(i){
  18.  
  19.             // Add title of first link with title to parent
  20.             $(this).attr('title', $('a[title]:first',this).attr('title'));
  21.  
  22.             // hover and trigger contained anchor event on click
  23.             $(this)
  24.             .mouseover(function(){
  25.                 window.status = $('a:first',this).attr('href');
  26.                 $(this).addClass(settings.hoverclass);
  27.             })
  28.             .mouseout(function(){
  29.                 window.status = '';
  30.                 $(this).removeClass(settings.hoverclass);
  31.             })
  32.             .bind('click',function(){
  33.                 $(this).find('a:first').trigger('click');
  34.             })
  35.  
  36.             // triggerable events on anchor itself
  37.  
  38.             .find('a').bind('focus',function(){
  39.                 $(this).parents('.'+ settings.clickableclass).addClass(settings.hoverclass);
  40.             }).bind('blur',function(){
  41.                 $(this).parents('.'+ settings.clickableclass).removeClass(settings.hoverclass);
  42.             }).end()
  43.  
  44.             .find('a:first').bind('click',function(e){
  45.                 if(settings.follow == true)
  46.                 {
  47.                     window.location = this.href;
  48.                 }
  49.                 e.stopPropagation(); // stop event bubbling to parent
  50.             }).end()
  51.  
  52.             .find('a',this).not(':first').bind('click',function(){
  53.                 $(this).parents('.'+ settings.clickableclass).find('a:first').trigger('click');
  54.                 return false;
  55.             });
  56.         });
  57.         return this;
  58.     };
  59. })(jQuery);
  60.  

the value of "target" , "_blank" is not work .... I highlight the code part regarding this, please check and give me a solution ASAP. You can mail me at : [removed email]



Thanks,
Anes
Sep 13 '11 #1
1 2092
acoder
16,027 Expert Mod 8TB
Can you show the HTML version, i.e. as it appears in the client browser (view source).
Sep 14 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Joe Fallon | last post by:
I have a sample web form in C# that works correctly. When I translated it to VB I can't get one feature in it working. ============================================== The part that does not work in...
12
by: Don Juan | last post by:
I have a simple html document I have been using for some time on my (i.e.) abc.com domain that uses cookies. I recently purchased a new domain name and set up a service to redirect my new domain...
1
by: SammyBar | last post by:
Hi all, I'm having troubles with a Symbol 9000 device (Compact Framework v 1.1) when activating the barcode scanner from a window. The problem is related to the Activated event of the form which...
5
by: Nathan Sokalski | last post by:
I am creating an ASP.NET application in a subdirectory of what IIS uses as the root directory (C:\Inetpub\wwwroot\). I am using the version of IIS that comes with Windows XP Pro SP2. Some of my...
1
by: APA | last post by:
Well, I've figured out a way around this mess. I have no idea why it doesn't work the way I think it should but I do know how to get it to work. The scenario is that I have a form that has one...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why is my AJAX page not updated properly when using an HTTP GET request in Internet Explorer?...
13
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
This is a follow-up to my post "Silverlight video doesn't work when file is streamed from handler in ASP.net" at...
7
by: neovantage | last post by:
Hey all, I am developing a portfolio and i am having problem relate to Easy Slider 1.5 jquery plugin in IE6. It shows all the images in IE6 as it must show 1 image at a time. It is working fine in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.