конкатенация строки
Всем привет, перепробовал все варианты которые на ум приходили, не ладится что-то со строками))
вообщем надо слеш добавить перед решёткой...
thisLink = $("a[href=+ '/' + #" + thisDestination.attr("id") + "]");
на такой вариант ругается |
thisLink = $("a[href=+ "/" + #" + thisDestination.attr("id") + "]");
так выдает Uncaught Error: Syntax error, unrecognized expression: NaNp1] |
может быть так?
thisLink = $("a[href=" + "/#" + thisDestination.attr("id") + "]");
|
Цитата:
|
Сам скрипт, у меня у перед сыллками / чтобы с других страниц возврашался без слеша всё ок, а как его к этому выражению приделать не знаю)
//scroll
var theDestinations = $('a[id]');
theDestinations.each(function(i){
var thisDestination = $(this),
thisDestinationOffset = thisDestination.offset(),
thisLink = $("a[href=" + "/#" + thisDestination.attr("id") + "]");
if(thisLink.length > 0) {
thisLink.click(function(){
$('html,body').animate({scrollTop : thisDestinationOffset.top-70}, 1000);
return false;
});
}
});
|
thisLink = $("a[href='/#" + thisDestination.attr("id") + "']");
|
tsigel,
Спасибо |
Пожалуйста :)
|
| Часовой пояс GMT +3, время: 23:43. |