web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Adding a Horizontal Scroll Bar to the Java Script/IFrame

(0) ShareShare
ReportReport
Posted on by 50

I am new to this JavaScript/IFrame Coding.

Can you tell m where I would need to put in my code for a horizontal Scroll?


iFRAME_OnLoad: function () {

// Grab the iFrame element.
// Check it's fully loaded and we have the page is correct.
var iFrame = document.getElementById("IFRAME_TIN_CLAIMS");
if (iFrame.readyState != "complete") { return; }
if (iFrame.src.indexOf("/_forms/print/print.aspx") == -1) { return; }

// Grab the preview iFrame as a jQuery object. Remove the toolbar.
var IF1 = jQuery("#IFRAME_TIN_CLAIMS");
IF1.contents().find("tr#printHeader").remove();

// Grab the sub-iFrame within the preview iFrame.
var IF2 = IF1.contents().find("iframe#printMain");
// Remove the big header and icon
IF2.contents().find("tr.ms-crm-Form-HeaderContainer").remove();
// Remove the big whitespace at the top
IF2.contents().find("div.ms-crm-Tab-Print").first().remove();
// Remove a bunch of whitespace around the second iFrame
IF2.contents().find("td.ms-crm-Form-Page-Main-cell").css("padding", "0px");
// Reinstate the whitespace next to the scrollbar
IF2.contents().find("td.ms-crm-Form-Page-Main-cell").css("padding-right", "0px");
// Remove the big whitespace at the bottom
IF2.contents().find("td.ms-crm-Form-Footer").parent().remove();

// Remove the header text. The text isn't within any specific tag so just performing a replace.
// The only part of the code that isn't directly re-usable
//IF2.contents().find("dhc_ppocaveragediscount_d").css("background-color", "red");
IF2.contents().find("div.ms-crm-Tab-Print").each(function () {
// jQuery(this).html(jQuery(this).html().replace("Contact Information", ""));
// jQuery(this).html(jQuery(this).html().replace("Provider TIN History", ""));
// jQuery(this).html(jQuery(this).html().replace("Notes", ""));
});

// Expand Op Site Data tab, revealing the fully rendered preview
var elTab = Xrm.Page.ui.tabs.get("general");
elTab.setDisplayState("expanded");

},


__namespace: true
};

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at

    set overflow attribute of iframe to auto  

    like setStyles('overflow': 'auto') this will enable scroll based on page content.

  • wsilage Profile Picture
    50 on at

    Thanks, where do I add this in my jscript though?

  • Royal King Profile Picture
    27,686 on at

    check this post that has live example with script to enable scrolling

    www.nazmulweb.com/.../Dynamically_Set_Scrolling_in_Iframe.aspx

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans