zintis8789 Posted January 5, 2010 Report Share Posted January 5, 2010 Es izmantoju smarkup text editoru. Vienam textarea radas smarkup dizains bet otram nerādas kods: <script type="text/javascript" src="smarkup/smarkup.js"></script> <script type="text/javascript" src="smarkup/conf/html/conf.js"></script> <p>Teksts: <textarea name="zina" id="html"> </textarea> <p>Teksts: <textarea name="ievads" id="html" > </textarea> <script type="text/javascript"> SMarkUp.bind( 'html', //textarea id 'html', //makup configuration name 300 //height of textarea ); </script> <script type="text/javascript"> var remove = document.getElementById('remove'); remove.onclick = function() { if (this.rel == 'on') { this.innerHTML = 'Return SmartMarkUP Back'; this.rel = 'off'; var textarea = SMarkUp.getInstance('html'); textarea.remove(); } else { this.innerHTML = 'Remove SmartMarkUP'; this.rel = 'on'; SMarkUp.bind( 'html', //textarea id 'html', //makup configuration name 300 //height of textarea ); } return false; }; </script> Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted January 5, 2010 Report Share Posted January 5, 2010 Nedrīkst būt elementi ar vienādiem id. Quote Link to comment Share on other sites More sharing options...
bubu Posted January 5, 2010 Report Share Posted January 5, 2010 id atribūtam jābūt unikālam. T.i. dokumentā nedrīkst būt divi html elementi ar vienādām id atribūtu vērtībām. Taisi dažādas id atribūtu vērtības un izsauc SMarkUp.bind divas reizes katram atsevišķi. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted January 5, 2010 Author Report Share Posted January 5, 2010 (edited) Nedrīkst būt elementi ar vienādiem id. Es meiģināju: <script type="text/javascript" src="smarkup/smarkup.js"></script> <script type="text/javascript" src="smarkup/conf/html/conf.js"></script> <p>Teksts: <textarea name="zina" id="html"> </textarea> <p>Teksts: <textarea name="ievads" id="html1" > </textarea> <script type="text/javascript"> SMarkUp.bind( 'html', //textarea id 'html', //makup configuration name 300 //height of textarea ); </script> <script type="text/javascript"> var remove = document.getElementById('remove'); remove.onclick = function() { if (this.rel == 'on') { this.innerHTML = 'Return SmartMarkUP Back'; this.rel = 'off'; var textarea = SMarkUp.getInstance('html'); textarea.remove(); } else { this.innerHTML = 'Remove SmartMarkUP'; this.rel = 'on'; SMarkUp.bind( 'html', //textarea id 'html', //makup configuration name 300 //height of textarea ); } return false; }; </script> <script type="text/javascript"> SMarkUp.bind( 'html1', //textarea id 'html1', //makup configuration name 300 //height of textarea ); </script> <script type="text/javascript"> var remove = document.getElementById('remove'); remove.onclick = function() { if (this.rel == 'on') { this.innerHTML = 'Return SmartMarkUP Back'; this.rel = 'off'; var textarea = SMarkUp.getInstance('html1'); textarea.remove(); } else { this.innerHTML = 'Remove SmartMarkUP'; this.rel = 'on'; SMarkUp.bind( 'html1', //textarea id 'html1', //makup configuration name 300 //height of textarea ); } return false; }; </script> Bet tikuntā otram textaream neradas dizains Edited January 5, 2010 by zintis8789 Quote Link to comment Share on other sites More sharing options...
bubu Posted January 5, 2010 Report Share Posted January 5, 2010 Pieņemu, ka "makup configuration name" arguments nav jāmaina no "html" uz kaut ko citu. Katrā ziņā apskaties dokumentācijā, ko tieši nozīmē pirmais un otrais arguments bind funkcijai. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.