Jump to content

ZoNT

Expert
  • Posts

    1,474
  • Joined

  • Last visited

Everything posted by ZoNT

  1. Естественно, имелось в виду "ПРОСИТ исправить"
  2. Открыываешь флэш, втавляешь в окошко редактирования экшен-скрипта скрипт, на кнопку "Auto format" готово. Единственная проблема - если есть нессовтетствия экшенскрипту (фактически считающиеся ошибками), то он не просит их сначала исправить...
  3. Ты просто не умеешь делать нормальные пнг...
  4. Делаешь ещё один блочный элемент такой же ширины (если нужен гор-й скроллбар) и высотой например 15px (чтобы только скроллбар поместился. В него добавляешь ещё див, но шириной = ширине контента того дива, который будем скроллить. В итоге в новом диве появляется скроллбар, который скроллит ЭТОТ (а нам нужно старый) див на нужные расстояния. Даллее делаем старому диву overflow:hidden; и у него пропадает скроллбар. Далее назначаем на onscroll новогму диву функцию: div.onscroll = function(){old_div.scrollLeft = this.scrollLeft} Теперь новый див (вактически - скроллбар) можно спозиционировать хоть свеху, хоть посередине, хоть вообще в другом месте страницы. То же самое и с вертикальным скроллом.
  5. Задачка тривиальна, надо только совсем чуть-чуть подумать головой... Ответ: всё что перечислено - можно.
  6. Отформатируешь сам: SEMods.Controls=function(){};SEMods.Controls.Autocompleter=function(obj,source){if(!SEMods.Controls.Autocompleter.hacks){SEMods.Controls.Autocompleter.should_check_double_fire=SEMods.Controls.Auto completer.should_check_missing_events=navigator.userAgent.indexOf('AppleWebKit/4')!=-1;SEMods.Controls.Autocompleter.should_use_iframe=navigator.userAgent.indexOf('MSIE 6.0')!=-1;SEMods.Controls.Autocompleter.hacks=true;} this.obj=obj;this.obj.autocompleter=this;this.clear_placeholder();if(source){this.set_source(source);} this.obj.onfocus=function(){this.focused=true;this.clear_placeholder();this.results_text='';this.set_class('');this.dirty_results();this.show();this.capture_submit();}.bind(this);this.obj.onblur=function(){if(!this.suggestions){this._onselect(false);} this.focused=false;this.hide();this.update_class();if(!this.obj.value){var noinput=this.source.gen_noinput();this.obj.value=noinput?noinput:'';this.set_class('autocompleter_placeholder')}}.bind(this);this.obj.onkeyup=function(event){return this._onkeyup(event?event:window.event)}.bind(this);this.obj.onkeydown=function(event){return this._onkeydown(event?event:window.event)}.bind(this);this.obj.onkeypress=function(event){return this._onkeypress(event?event:window.event)}.bind(this);this.list=document.createElement('div');this.list.className='autocompleter_list';this.list.style.width=(this.obj.offsetWidth-2)+'px';if(this.obj.nextSibling){this.obj.parentNode.insertBefore(this.list,this.obj.nextSibling);} else{this.obj.parentNode.appendChild(this.list);} this.obj.parentNode.insertBefore(document.createElement('br'),this.list);if(this.should_use_iframe&&!SEMods.Controls.Autocompleter.iframe){SEMods.Controls.Autocompleter.iframe=document.createElement('iframe');SEMods.Controls.Autocompleter.iframe.className='autocompleter_iframe';SEMods.Controls.Autocompleter.iframe.style.display='none';SEMods.Controls.Autocompleter.iframe.frameBorder=0;document.body.appendChil d(SEMods.Controls.Autocompleter.iframe);} this.focused=true;if(this.source){this.selectedindex=-1;this._onkeyup();this.set_class('');this.capture_submit();} else{this.hide();} this._framedown();};SEMods.Controls.Autocompleter.prototype={max_results:10,set_source:function(source){this.source=source;this.source.set_owner(this);this.status=0;this.cache={};this.last_search=0;this.suggestions=[];},_onkeyup:function(e){this.last_key=e?e.keyCode:-1;if(this.key_down==this.last_key){this.key_down=0;} switch(this.last_key){case 27:this.selectedindex=-1;this._onselect(false);this.hide();break;case undefined:case 0:case 13:case 37:case 38:case 39:case 40:break;default:this.dirty_results();if(this.should_check_missing_events){setTimeout(function(){this.dirty_results()}.bind(this),50);} break;}},_onkeydown:function(e){this.key_down=this.last_key=e?e.keyCode:-1;switch(this.last_key){case 9:this.select_suggestion(this.selectedindex);break;case 13:this.select_suggestion(this.selectedindex);this.hide();return this.submit_keydown_return=this._onsubmit(this.get_current_selection());case 38:if(this.check_double_fire())return;this.set_suggestion(this.selectedindex-1);return false;case 40:if(this.check_double_fire())return;this.set_suggestion(this.selectedindex+1);return false;}},_onkeypress:function(e){this.last_key=e?e.keyCode:-1;switch(this.last_key){case 38:case 40:return false;case 13:return this.submit_keydown_return;} return true;},_onfound:function(obj){return this.onfound?this.onfound.call(this,obj):true;},_onsubmit:function(obj){if(this.onsubmit){var ret=this.onsubmit.call(this,obj);if(ret&&this.obj.form){if(!this.obj.form.onsubmit||this.obj.form.onsubmit()){this.obj.form.submit();} return false;} return ret;}else{this.advance_focus();return false;}},_onselect:function(obj){if(this.onselect){this.onselect.call(this,obj);}},capture_submit:function(){if(!this.should_check_missing_events)return;if((!this.captured_form||this.captured_substitute!=this.captured_form.onsubmit)&&this.obj.form){this.captured_form=this.obj.form;this.captured_event=this.obj.form.onsubmit ;this.captured_substitute=this.obj.form.onsubmit=function(){return((this.key_down&&this.key_down!=13&&this.key_down!=9)?this.submit_keydown_return:(this.captured_event?this.captured_event.apply(arguments,this.captured_form):true))?true:false;}.bind(this);}},check_double_fire:function(){if(!this.should_check_double_fire){return false;} else{this.double_fire++;return this.double_fire%2==1;}},double_fire:0,set_suggestion:function(index){if(!this.suggestions||this.suggestions.length<=index){return} this.selectedindex=(index<=-1)?-1:index;var nodes=this.list.childNodes;for(var i=0;i0){var perfect_match=false;this.list.innerHTML='';for(var i=0;i<=(time-this.source.search_limit)&&this.source.status==0&&this.status==0){this.perform_search();} else{if(this.status==0&&this.source.status==1){this.set_message(this.source.gen_loading());this.status=2;} else if(this.status==0&&this.source.status==0){if(!this.search_timeout){this.search_timeout=setTimeout(function(){this.search_timeout=false;if(this.status==0&&this.source.status==0){this.perform_search();}}.bind(this),this.source.search_limit-(time-this.last_search));}}} if(this.suggestions){var match=-1;this.found_suggestions(this.suggestions,this.obj.value,true);for(var i=0;i';this.reset_iframe();} else{this.hide();}},reset_iframe:function(){if(!this.should_use_iframe){return} SEMods.Controls.Autocompleter.iframe.style.top=elementY(this.list)+'px';SEMods.Controls.Autocompleter.iframe.style.left=elementX(this.list)+'px';SEMods.Controls.Autocompleter.iframe.style.width=this.list.offsetWidth+'px';SEMods.Controls.Autocompleter.iframe.style.height=this.list.offsetHeight+'px';SEMods.Controls.Autocompleter.iframe.style.display='';},advance_focus:function(){setTimeout(function(){var inputs=this.obj.form?this.obj.form:document.getElementsByTagName('input');var found=false;for(var i=0;i=search[i].length&&value[j].substring(0,search[i].length).toLowerCase()==search[i].toLowerCase()){found=true;value[j]='';break;}} if(!found){return false;}}} return true;};SEMods.Controls.Autocompleter.source.prototype={cache_results:true,search_limit:10,set_owner:function(obj){this.owner=obj;},highlight_found:function(result,search){var html=new Array();result=result.split(' ');search=search.split(' ');search.sort(function(a,b){return a.length=search[j].length&&result[i].substring(0,search[j].length).toLowerCase()==search[j].toLowerCase()){html.push('',SEMods.U.htmlspecialchars(result[i].substring(0,search[j].length)),'',SEMods.U.htmlspecialchars(result[i].substring(search[j].length,result[i].length)),' ');found=true;break;}} if(!found){html.push(SEMods.U.htmlspecialchars(result[i]),' ');}} return html.join('');},gen_nomatch:function(){return this.text_nomatch!=null?this.text_nomatch:'No matches found';},gen_loading:function(){return this.text_loading!=null?this.text_loading:'Loading...';},gen_placeholder:function(){return this.text_placeholder!=null?this.text_placeholder:'Start typing...';},gen_noinput:function(){return this.text_noinput!=null?this.text_noinput:'Start typing...';}};SEMods.Controls.Autocompleter.friend_source=function(get_param){this.status=1;var ajax=new SEMods.Ajax(function(obj,text){var r=[];try{r=eval('('+text+')');this.friends=r.friends;this.status=0;}catch(e){this.status=0;this.friends=[];} if(this.owner&&this.owner.source_loaded){this.owner.source_loaded();}}.bind(this));ajax_endpoint=(/\/apps\//i.test(document.location))?'../ajax_autocomplete_friends.php':'ajax_autocomplete_friends.php';ajax.get(ajax_endpoint+'?task=get'+get_param);this.parent.construct(this);};SEMods.Controls.Autocompleter.friend_source.extend(SEMods.Controls.Autocompleter.source);SEMods.Controls.Autocompleter.friend_source.prototype.text_noinput=SEMods.C ontrols.Autocompleter.friend_source.prototype.text_placeholder='Start typing a friend\'s name';SEMods.Controls.Autocompleter.friend_source.prototype.search_value=function(text){if(this.status==0){var results=new Array();for(var i=0;i=this.owner.max_results){break;}} this.owner.found_suggestions(results,text,false);return true;}};SEMods.Controls.Autocompleter.friend_source.prototype.gen_html=function(friend,highlight){var html=new Array(' ');html.push(this.highlight_found(friend.t,highlight),' ',friend.n,' ');return html.join('');};SEMods.Controls.Autocompleter.custom_source=function(options){this.status=0;this.options=options;this.parent.construct(this);};SEMods.Controls.Autocompleter.custom_source.prototype={search_limit:10,text_placeholder:false,text_noinput:false,search_value:function(text){var results=new Array();for(var i=0;i=this.owner.max_results){break;}} this.owner.found_suggestions(results,text,false);return true;},gen_html:function(result,highlight){var html=new Array(' ');html.push(this.highlight_found(result.t,highlight),' ');if(result.s){html.push(' ',friend.n,' ');} return html.join('');}};SEMods.Controls.Autocompleter.custom_source.extend(SEMods.Controls.Autocompleter.source);
  7. В направлении джаваскрипта... Только вот зачем такие заморочки?
  8. Лучше читай по ссылке: метод print() не является стандартным, так что каждый браузер как хочет, так и поддерживает...
  9. Читай внимательнее. Они не считаюся современными браузерами, это минимальная версия, в которой будет работать свойство.
  10. Ну если нужно растянуть, тогда да (фон не тянется).
  11. html, body { width: 100%; height: 100%; } не катит?
  12. У меня в Опере всё нормально. А зачем такое извращение в дивом и картинкой, если можно просто боди задать бэкграунд???
  13. http://www.webmaster.ee/javascript/JavaScr...ndow.html#print
  14. Интересный код. Да и вообще, сама постановка вопроса мне нравится...
  15. Надо сохранить jpeg в прогрессивном формате. Но ИЕ не умеет отображать джепеги в прогрессивном формате на стадии загрузки, поэтому он не отрисует картинку, пока она не загрузится полностью...
  16. Не понял, зачем на форум постить статьи с хабра? Зачем мусорить?
  17. У меня и в фф остаются попапы... Тебе бы переделать скрипт по другому....
  18. Надо задать боди высоту 100%, позицию релэйтив и оверфлоу = хидден и скролл пропадёт.
  19. Фигасе Так ты матчасть (основы javascript) не знаешь?!!!
  20. Фигасе Это ж как тогда мы находили решение задач по математике, которых не знали, решение головоломок, которых не знали? Не думая что-ли? Из астрала решение приходит???
  21. Совершенно нормально, если не смотреть на фиговый слог... Сам всегда пишу Ё, тянуться не лень...
  22. А зачем следить, если можно погуглить, найти пример, посмотреть, подумать и сделать как надо...
  23. Технология стара как мир
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy