Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. $(document).ready(function () {
  2. $('.drag').on("mouseover", function () {
  3. AfterPostBack();
  4. $(this).draggable()
  5. .click( function () {
  6. $(this).draggable({ disabled: false });
  7. }).dblclick( function () {
  8. $(this).draggable({ disabled: true });
  9. });
  10. });
  11. $('.text_label').on("blur",function () {
  12.  
  13. $(this).removeClass('focus');
  14. });
  15. });
  16.  
  17. var AfterPostBack = function () {
  18. $('.drag').draggable("option", "containment", 'parent');
  19. $('.drag').draggable("option", "snap", 'parent');
  20. $('.drag').draggable("option", "cursor", 'move');
  21. };
  22.  
  23. <script type="text/javascript" src="Scripts/jquery-1.8.0.min.js"></script>
  24. <script type="text/javascript" src="Scripts/jquery-ui-1.8.23.custom.min.js"></script>
  25. <script type="text/javascript" src="Scripts/myplugin.js"></script>
  26. <link href="Styles/myplugin.css" rel="stylesheet" type="text/css" />
  27.  
  28. <asp:UpdatePanel runat="server" ID="UP1" UpdateMode="Conditional" ChildrenAsTriggers="false">
  29. <ContentTemplate>
  30. <asp:Button ID="btn_AddText" runat="server" Text="Add Text" OnClick="AddText" />
  31. <asp:PlaceHolder ID="ph1" runat="server">
  32. <div class="drag">
  33. <asp:Label ID="lbl1" class="text_label" runat="server" Text="Click Me"/>
  34. </div>
  35. </asp:PlaceHolder>
  36. </ContentTemplate>
  37. <Triggers>
  38. <asp:AsyncPostBackTrigger ControlID="btn_AddText" EventName="Click" />
  39. </Triggers>
  40. </asp:UpdatePanel>
  41.  
  42. Sys.Application.add_init(function () {
  43. // Initialization code here, meant to run once.
  44. try {
  45. //doOnes();
  46. doAllways();
  47. } catch (e) {
  48. console.log('Sys.Application.add_init: ', e);
  49. }
  50. });
  51.  
  52. $(document).ready(function () {
  53. console.log('document.ready');
  54. //doAllways();
  55. }
  56.  
  57. function pageLoad() {
  58. console.log('pageLoad');
  59. //doAftrerAjax();
  60. doAllways();
  61. }
  62.  
  63. function doOnes() {
  64. console.log(doOnes);
  65. }
  66.  
  67. function doAftrerAjax() {
  68. console.log('pageLoad');
  69. }
  70.  
  71. function doAllways(){
  72. console.log('doAftrerAjax
  73. AfterPostBack(); <---this the place for the code
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement